brighterscript 1.0.0-alpha.1 → 1.0.0-alpha.13

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 (316) hide show
  1. package/CHANGELOG.md +362 -248
  2. package/README.md +2 -2
  3. package/bsconfig.schema.json +1 -1
  4. package/dist/CodeActionUtil.d.ts +11 -2
  5. package/dist/CodeActionUtil.js +17 -3
  6. package/dist/CodeActionUtil.js.map +1 -1
  7. package/dist/CommentFlagProcessor.d.ts +4 -4
  8. package/dist/CommentFlagProcessor.js +5 -3
  9. package/dist/CommentFlagProcessor.js.map +1 -1
  10. package/dist/DependencyGraph.js.map +1 -1
  11. package/dist/DiagnosticCollection.js +2 -2
  12. package/dist/DiagnosticCollection.js.map +1 -1
  13. package/dist/DiagnosticFilterer.js +3 -3
  14. package/dist/DiagnosticFilterer.js.map +1 -1
  15. package/dist/DiagnosticMessages.d.ts +15 -5
  16. package/dist/DiagnosticMessages.js +19 -9
  17. package/dist/DiagnosticMessages.js.map +1 -1
  18. package/dist/LanguageServer.d.ts +11 -10
  19. package/dist/LanguageServer.js +87 -58
  20. package/dist/LanguageServer.js.map +1 -1
  21. package/dist/Logger.d.ts +2 -0
  22. package/dist/Logger.js +5 -3
  23. package/dist/Logger.js.map +1 -1
  24. package/dist/Program.d.ts +76 -46
  25. package/dist/Program.js +254 -180
  26. package/dist/Program.js.map +1 -1
  27. package/dist/ProgramBuilder.d.ts +7 -7
  28. package/dist/ProgramBuilder.js +37 -43
  29. package/dist/ProgramBuilder.js.map +1 -1
  30. package/dist/Scope.d.ts +33 -23
  31. package/dist/Scope.js +222 -147
  32. package/dist/Scope.js.map +1 -1
  33. package/dist/SemanticTokenUtils.d.ts +14 -0
  34. package/dist/SemanticTokenUtils.js +81 -0
  35. package/dist/SemanticTokenUtils.js.map +1 -0
  36. package/dist/SymbolTable.d.ts +9 -3
  37. package/dist/SymbolTable.js +40 -13
  38. package/dist/SymbolTable.js.map +1 -1
  39. package/dist/XmlScope.d.ts +7 -2
  40. package/dist/XmlScope.js +67 -29
  41. package/dist/XmlScope.js.map +1 -1
  42. package/dist/astUtils/AstEditor.d.ts +27 -0
  43. package/dist/astUtils/AstEditor.js +97 -0
  44. package/dist/astUtils/AstEditor.js.map +1 -0
  45. package/dist/astUtils/AstEditor.spec.d.ts +1 -0
  46. package/dist/astUtils/AstEditor.spec.js +133 -0
  47. package/dist/astUtils/AstEditor.spec.js.map +1 -0
  48. package/dist/astUtils/creators.d.ts +15 -1
  49. package/dist/astUtils/creators.js +39 -9
  50. package/dist/astUtils/creators.js.map +1 -1
  51. package/dist/astUtils/creators.spec.js +4 -4
  52. package/dist/astUtils/creators.spec.js.map +1 -1
  53. package/dist/astUtils/index.js +1 -1
  54. package/dist/astUtils/reflection.d.ts +20 -8
  55. package/dist/astUtils/reflection.js +42 -1
  56. package/dist/astUtils/reflection.js.map +1 -1
  57. package/dist/astUtils/reflection.spec.js +115 -115
  58. package/dist/astUtils/reflection.spec.js.map +1 -1
  59. package/dist/astUtils/stackedVisitor.js.map +1 -1
  60. package/dist/astUtils/stackedVisitor.spec.js +13 -13
  61. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  62. package/dist/astUtils/visitors.js +1 -1
  63. package/dist/astUtils/visitors.js.map +1 -1
  64. package/dist/astUtils/visitors.spec.js +28 -28
  65. package/dist/astUtils/visitors.spec.js.map +1 -1
  66. package/dist/astUtils/xml.d.ts +4 -3
  67. package/dist/astUtils/xml.js +8 -3
  68. package/dist/astUtils/xml.js.map +1 -1
  69. package/dist/bscPlugin/BscPlugin.d.ts +2 -1
  70. package/dist/bscPlugin/BscPlugin.js +4 -0
  71. package/dist/bscPlugin/BscPlugin.js.map +1 -1
  72. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +5 -6
  73. package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
  74. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +30 -30
  75. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  76. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.d.ts +7 -0
  77. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js +63 -0
  78. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.js.map +1 -0
  79. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.d.ts +1 -0
  80. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js +45 -0
  81. package/dist/bscPlugin/semanticTokens/SemanticTokensProcessor.spec.js.map +1 -0
  82. package/dist/diagnosticUtils.d.ts +1 -0
  83. package/dist/diagnosticUtils.js +14 -7
  84. package/dist/diagnosticUtils.js.map +1 -1
  85. package/dist/examples/plugins/removePrint.js +2 -2
  86. package/dist/examples/plugins/removePrint.js.map +1 -1
  87. package/dist/files/BrsFile.Class.spec.js +486 -71
  88. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  89. package/dist/files/BrsFile.d.ts +48 -23
  90. package/dist/files/BrsFile.js +403 -233
  91. package/dist/files/BrsFile.js.map +1 -1
  92. package/dist/files/BrsFile.spec.js +367 -316
  93. package/dist/files/BrsFile.spec.js.map +1 -1
  94. package/dist/files/XmlFile.d.ts +13 -6
  95. package/dist/files/XmlFile.js +27 -21
  96. package/dist/files/XmlFile.js.map +1 -1
  97. package/dist/files/XmlFile.spec.js +274 -228
  98. package/dist/files/XmlFile.spec.js.map +1 -1
  99. package/dist/files/tests/imports.spec.js +49 -49
  100. package/dist/files/tests/imports.spec.js.map +1 -1
  101. package/dist/globalCallables.d.ts +3 -1
  102. package/dist/globalCallables.js +359 -87
  103. package/dist/globalCallables.js.map +1 -1
  104. package/dist/index.js +2 -1
  105. package/dist/index.js.map +1 -1
  106. package/dist/interfaces.d.ts +51 -14
  107. package/dist/lexer/Lexer.d.ts +14 -1
  108. package/dist/lexer/Lexer.js +91 -21
  109. package/dist/lexer/Lexer.js.map +1 -1
  110. package/dist/lexer/Lexer.spec.js +187 -132
  111. package/dist/lexer/Lexer.spec.js.map +1 -1
  112. package/dist/lexer/Token.d.ts +2 -2
  113. package/dist/lexer/TokenKind.d.ts +7 -1
  114. package/dist/lexer/TokenKind.js +51 -3
  115. package/dist/lexer/TokenKind.js.map +1 -1
  116. package/dist/lexer/index.js +2 -1
  117. package/dist/lexer/index.js.map +1 -1
  118. package/dist/parser/BrsTranspileState.d.ts +7 -0
  119. package/dist/parser/BrsTranspileState.js +10 -1
  120. package/dist/parser/BrsTranspileState.js.map +1 -1
  121. package/dist/parser/Expression.d.ts +23 -5
  122. package/dist/parser/Expression.js +124 -75
  123. package/dist/parser/Expression.js.map +1 -1
  124. package/dist/parser/Parser.Class.spec.js +159 -60
  125. package/dist/parser/Parser.Class.spec.js.map +1 -1
  126. package/dist/parser/Parser.d.ts +114 -26
  127. package/dist/parser/Parser.js +471 -126
  128. package/dist/parser/Parser.js.map +1 -1
  129. package/dist/parser/Parser.spec.js +396 -235
  130. package/dist/parser/Parser.spec.js.map +1 -1
  131. package/dist/parser/SGParser.d.ts +41 -4
  132. package/dist/parser/SGParser.js +186 -175
  133. package/dist/parser/SGParser.js.map +1 -1
  134. package/dist/parser/SGParser.spec.js +35 -22
  135. package/dist/parser/SGParser.spec.js.map +1 -1
  136. package/dist/parser/SGTypes.d.ts +206 -38
  137. package/dist/parser/SGTypes.js +470 -161
  138. package/dist/parser/SGTypes.js.map +1 -1
  139. package/dist/parser/SGTypes.spec.d.ts +1 -0
  140. package/dist/parser/SGTypes.spec.js +351 -0
  141. package/dist/parser/SGTypes.spec.js.map +1 -0
  142. package/dist/parser/Statement.d.ts +92 -18
  143. package/dist/parser/Statement.js +287 -58
  144. package/dist/parser/Statement.js.map +1 -1
  145. package/dist/parser/Statement.spec.js +11 -11
  146. package/dist/parser/Statement.spec.js.map +1 -1
  147. package/dist/parser/TranspileState.d.ts +1 -1
  148. package/dist/parser/TranspileState.js +15 -7
  149. package/dist/parser/TranspileState.js.map +1 -1
  150. package/dist/parser/index.js +1 -1
  151. package/dist/parser/tests/Parser.spec.d.ts +8 -7
  152. package/dist/parser/tests/Parser.spec.js +12 -8
  153. package/dist/parser/tests/Parser.spec.js.map +1 -1
  154. package/dist/parser/tests/controlFlow/For.spec.js +50 -50
  155. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  156. package/dist/parser/tests/controlFlow/ForEach.spec.js +31 -31
  157. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  158. package/dist/parser/tests/controlFlow/If.spec.js +174 -156
  159. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  160. package/dist/parser/tests/controlFlow/While.spec.js +32 -32
  161. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  162. package/dist/parser/tests/expression/Additive.spec.js +21 -21
  163. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  164. package/dist/parser/tests/expression/ArrayLiterals.spec.js +105 -105
  165. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  166. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +148 -124
  167. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  168. package/dist/parser/tests/expression/Boolean.spec.js +17 -17
  169. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  170. package/dist/parser/tests/expression/Call.spec.js +30 -30
  171. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  172. package/dist/parser/tests/expression/Exponential.spec.js +16 -16
  173. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  174. package/dist/parser/tests/expression/Function.spec.js +247 -247
  175. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  176. package/dist/parser/tests/expression/Indexing.spec.js +73 -73
  177. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  178. package/dist/parser/tests/expression/Multiplicative.spec.js +36 -36
  179. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  180. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +59 -47
  181. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  182. package/dist/parser/tests/expression/PrefixUnary.spec.js +35 -35
  183. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  184. package/dist/parser/tests/expression/Primary.spec.js +26 -26
  185. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  186. package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
  187. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +170 -0
  188. package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
  189. package/dist/parser/tests/expression/Relational.spec.js +42 -42
  190. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  191. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +8 -8
  192. package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
  193. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +12 -12
  194. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  195. package/dist/parser/tests/expression/TernaryExpression.spec.js +100 -100
  196. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  197. package/dist/parser/tests/statement/AssignmentOperators.spec.js +35 -35
  198. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  199. package/dist/parser/tests/statement/Declaration.spec.js +39 -39
  200. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  201. package/dist/parser/tests/statement/Dim.spec.js +21 -21
  202. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  203. package/dist/parser/tests/statement/Function.spec.js +192 -192
  204. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  205. package/dist/parser/tests/statement/Goto.spec.js +11 -11
  206. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  207. package/dist/parser/tests/statement/Increment.spec.js +46 -46
  208. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  209. package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
  210. package/dist/parser/tests/statement/InterfaceStatement.spec.js +61 -0
  211. package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
  212. package/dist/parser/tests/statement/LibraryStatement.spec.js +10 -10
  213. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  214. package/dist/parser/tests/statement/Misc.spec.js +37 -36
  215. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  216. package/dist/parser/tests/statement/PrintStatement.spec.js +30 -30
  217. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  218. package/dist/parser/tests/statement/ReturnStatement.spec.js +43 -43
  219. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  220. package/dist/parser/tests/statement/Set.spec.js +69 -69
  221. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  222. package/dist/parser/tests/statement/Stop.spec.js +9 -9
  223. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  224. package/dist/parser/tests/statement/Throw.spec.js +5 -5
  225. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  226. package/dist/parser/tests/statement/TryCatch.spec.js +13 -13
  227. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  228. package/dist/preprocessor/Chunk.js.map +1 -1
  229. package/dist/preprocessor/Manifest.d.ts +1 -1
  230. package/dist/preprocessor/Preprocessor.js +1 -1
  231. package/dist/preprocessor/Preprocessor.js.map +1 -1
  232. package/dist/preprocessor/Preprocessor.spec.js +49 -49
  233. package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
  234. package/dist/preprocessor/PreprocessorParser.spec.js +72 -72
  235. package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
  236. package/dist/preprocessor/index.js +1 -1
  237. package/dist/types/ArrayType.js +5 -4
  238. package/dist/types/ArrayType.js.map +1 -1
  239. package/dist/types/ArrayType.spec.js +8 -8
  240. package/dist/types/ArrayType.spec.js.map +1 -1
  241. package/dist/types/BooleanType.js +3 -3
  242. package/dist/types/BooleanType.js.map +1 -1
  243. package/dist/types/BooleanType.spec.js +2 -2
  244. package/dist/types/BooleanType.spec.js.map +1 -1
  245. package/dist/types/BscType.d.ts +19 -5
  246. package/dist/types/BscType.js +9 -0
  247. package/dist/types/BscType.js.map +1 -1
  248. package/dist/types/CustomType.d.ts +8 -5
  249. package/dist/types/CustomType.js +17 -6
  250. package/dist/types/CustomType.js.map +1 -1
  251. package/dist/types/DoubleType.js +8 -8
  252. package/dist/types/DoubleType.js.map +1 -1
  253. package/dist/types/DoubleType.spec.js +2 -2
  254. package/dist/types/DoubleType.spec.js.map +1 -1
  255. package/dist/types/DynamicType.js +1 -1
  256. package/dist/types/DynamicType.js.map +1 -1
  257. package/dist/types/DynamicType.spec.js +2 -2
  258. package/dist/types/DynamicType.spec.js.map +1 -1
  259. package/dist/types/FloatType.d.ts +1 -1
  260. package/dist/types/FloatType.js +8 -8
  261. package/dist/types/FloatType.js.map +1 -1
  262. package/dist/types/FloatType.spec.js +2 -2
  263. package/dist/types/FloatType.spec.js.map +1 -1
  264. package/dist/types/FunctionType.d.ts +5 -11
  265. package/dist/types/FunctionType.js +24 -13
  266. package/dist/types/FunctionType.js.map +1 -1
  267. package/dist/types/FunctionType.spec.js +11 -5
  268. package/dist/types/FunctionType.spec.js.map +1 -1
  269. package/dist/types/IntegerType.d.ts +1 -1
  270. package/dist/types/IntegerType.js +8 -8
  271. package/dist/types/IntegerType.js.map +1 -1
  272. package/dist/types/IntegerType.spec.js +2 -2
  273. package/dist/types/IntegerType.spec.js.map +1 -1
  274. package/dist/types/InterfaceType.d.ts +8 -2
  275. package/dist/types/InterfaceType.js +42 -6
  276. package/dist/types/InterfaceType.js.map +1 -1
  277. package/dist/types/InterfaceType.spec.d.ts +1 -0
  278. package/dist/types/InterfaceType.spec.js +174 -0
  279. package/dist/types/InterfaceType.spec.js.map +1 -0
  280. package/dist/types/InvalidType.js +4 -4
  281. package/dist/types/InvalidType.js.map +1 -1
  282. package/dist/types/InvalidType.spec.js +2 -2
  283. package/dist/types/InvalidType.spec.js.map +1 -1
  284. package/dist/types/LazyType.d.ts +9 -7
  285. package/dist/types/LazyType.js +22 -10
  286. package/dist/types/LazyType.js.map +1 -1
  287. package/dist/types/LongIntegerType.d.ts +1 -1
  288. package/dist/types/LongIntegerType.js +8 -8
  289. package/dist/types/LongIntegerType.js.map +1 -1
  290. package/dist/types/LongIntegerType.spec.js +2 -2
  291. package/dist/types/LongIntegerType.spec.js.map +1 -1
  292. package/dist/types/ObjectType.d.ts +7 -4
  293. package/dist/types/ObjectType.js +6 -3
  294. package/dist/types/ObjectType.js.map +1 -1
  295. package/dist/types/ObjectType.spec.js +2 -2
  296. package/dist/types/ObjectType.spec.js.map +1 -1
  297. package/dist/types/StringType.js +3 -3
  298. package/dist/types/StringType.js.map +1 -1
  299. package/dist/types/StringType.spec.js +2 -2
  300. package/dist/types/StringType.spec.js.map +1 -1
  301. package/dist/types/UninitializedType.js +3 -3
  302. package/dist/types/UninitializedType.js.map +1 -1
  303. package/dist/types/VoidType.js +3 -3
  304. package/dist/types/VoidType.js.map +1 -1
  305. package/dist/types/VoidType.spec.js +2 -2
  306. package/dist/types/VoidType.spec.js.map +1 -1
  307. package/dist/types/helpers.d.ts +42 -0
  308. package/dist/types/helpers.js +113 -0
  309. package/dist/types/helpers.js.map +1 -0
  310. package/dist/util.d.ts +77 -17
  311. package/dist/util.js +247 -59
  312. package/dist/util.js.map +1 -1
  313. package/dist/validators/ClassValidator.d.ts +5 -1
  314. package/dist/validators/ClassValidator.js +59 -24
  315. package/dist/validators/ClassValidator.js.map +1 -1
  316. package/package.json +13 -13
package/dist/Program.d.ts CHANGED
@@ -1,14 +1,24 @@
1
- import type { CodeAction, CompletionItem, Position, Range, SignatureInformation } from 'vscode-languageserver';
1
+ import type { CodeAction, CompletionItem, Position, Range, SignatureInformation, SymbolInformation } from 'vscode-languageserver';
2
2
  import { Location } from 'vscode-languageserver';
3
3
  import type { BsConfig } from './BsConfig';
4
4
  import { Scope } from './Scope';
5
5
  import { BrsFile } from './files/BrsFile';
6
6
  import { XmlFile } from './files/XmlFile';
7
- import type { BsDiagnostic, File, FileReference, FileObj, BscFile } from './interfaces';
7
+ import type { BsDiagnostic, FileReference, FileObj, BscFile, SemanticToken } from './interfaces';
8
8
  import { XmlScope } from './XmlScope';
9
9
  import { Logger } from './Logger';
10
+ import type { ManifestValue } from './preprocessor/Manifest';
10
11
  import PluginInterface from './PluginInterface';
11
12
  import type { FunctionStatement, Statement } from './parser/Statement';
13
+ export interface SourceObj {
14
+ srcPath: string;
15
+ source: string;
16
+ definitions?: string;
17
+ }
18
+ export interface TranspileObj {
19
+ file: BscFile;
20
+ outputPath: string;
21
+ }
12
22
  export interface SignatureInfoObj {
13
23
  index: number;
14
24
  key: string;
@@ -55,13 +65,20 @@ export declare class Program {
55
65
  /**
56
66
  * The path to bslib.brs (the BrightScript runtime for certain BrighterScript features)
57
67
  */
58
- get bslibPkgPath(): string;
68
+ get bslibPkgPath(): "pkg:/source/roku_modules/bslib/bslib.brs" | "pkg:/source/roku_modules/rokucommunity_bslib/bslib.brs" | "pkg:/source/bslib.brs";
59
69
  get bslibPrefix(): "rokucommunity_bslib" | "bslib";
60
70
  /**
61
- * A map of every file loaded into this program, indexed by its original file location
71
+ * A map of every file loaded ino this program, indexed by its lower-case pkgPath
62
72
  */
63
- files: Record<string, BrsFile | XmlFile>;
64
73
  private pkgMap;
74
+ /**
75
+ * A map of every file loaded into this program, indexed by its lower-case srcPath
76
+ */
77
+ private files;
78
+ /**
79
+ * Get a copy of the list of files currently loaded in the program
80
+ */
81
+ getFiles(): BscFile[];
65
82
  private scopes;
66
83
  protected addScope(scope: Scope): void;
67
84
  /**
@@ -96,7 +113,7 @@ export declare class Program {
96
113
  * Get a list of all files that are included in the project but are not referenced
97
114
  * by any scope in the program.
98
115
  */
99
- getUnreferencedFiles(): File[];
116
+ getUnreferencedFiles(): BscFile[];
100
117
  /**
101
118
  * Get the list of errors for the entire program. It's calculated on the fly
102
119
  * by walking through every file, so call this sparingly.
@@ -106,9 +123,9 @@ export declare class Program {
106
123
  /**
107
124
  * Determine if the specified file is loaded in this program right now.
108
125
  * @param filePath
126
+ * @param normalizePath should the provided path be normalized before use
109
127
  */
110
- hasFile(filePath: string): boolean;
111
- getPkgPath(...args: any[]): any;
128
+ hasFile(filePath: string, normalizePath?: boolean): boolean;
112
129
  /**
113
130
  * roku filesystem is case INsensitive, so find the scope by key case insensitive
114
131
  * @param scopeName
@@ -122,51 +139,50 @@ export declare class Program {
122
139
  * Find the scope for the specified component
123
140
  */
124
141
  getComponentScope(componentName: string): XmlScope;
142
+ /**
143
+ * Update internal maps with this file reference
144
+ */
145
+ private assignFile;
146
+ /**
147
+ * Remove this file from internal maps
148
+ */
149
+ private unassignFile;
125
150
  /**
126
151
  * Load a file into the program. If that file already exists, it is replaced.
127
152
  * If file contents are provided, those are used, Otherwise, the file is loaded from the file system
128
- * @param relativePath the file path relative to the root dir
153
+ * @param srcDestOrPkgPath the absolute path, or the pkg path (i.e. `pkg:/path/to/file.brs`) or the destPath (i.e. `path/to/file.brs` relative to `pkg:/`)
129
154
  * @param fileContents the file contents
130
155
  */
131
- addOrReplaceFile<T extends BscFile>(relativePath: string, fileContents: string): T;
156
+ setFile<T extends BscFile>(srcDestOrPkgPath: string, fileContents: string): T;
132
157
  /**
133
158
  * Load a file into the program. If that file already exists, it is replaced.
134
159
  * @param fileEntry an object that specifies src and dest for the file.
135
160
  * @param fileContents the file contents. If not provided, the file will be loaded from disk
136
161
  */
137
- addOrReplaceFile<T extends BscFile>(fileEntry: FileObj, fileContents: string): T;
162
+ setFile<T extends BscFile>(fileEntry: FileObj, fileContents: string): T;
138
163
  /**
139
164
  * Ensure source scope is created.
140
165
  * Note: automatically called internally, and no-op if it exists already.
141
166
  */
142
167
  createSourceScope(): void;
143
- /**
144
- * Find the file by its absolute path. This is case INSENSITIVE, since
145
- * Roku is a case insensitive file system. It is an error to have multiple files
146
- * with the same path with only case being different.
147
- * @param pathAbsolute
148
- */
149
- getFileByPathAbsolute<T extends BrsFile | XmlFile>(pathAbsolute: string): T;
150
- /**
151
- * Get a list of files for the given (platform-normalized) pkgPath array.
152
- * Missing files are just ignored.
153
- */
154
- getFilesByPkgPaths<T extends BscFile[]>(pkgPaths: string[]): T;
155
- /**
156
- * Get a file with the specified (platform-normalized) pkg path.
157
- * If not found, return undefined
158
- */
159
- getFileByPkgPath<T extends BscFile>(pkgPath: string): T;
160
168
  /**
161
169
  * Remove a set of files from the program
162
- * @param absolutePaths
170
+ * @param srcPaths
163
171
  */
164
- removeFiles(absolutePaths: string[]): void;
172
+ removeFiles(srcPaths: string[]): void;
165
173
  /**
166
174
  * Remove a file from the program
167
- * @param pathAbsolute
175
+ * @param filePath can be a srcPath, a pkgPath, or a destPath (same as pkgPath but without `pkg:/`)
176
+ * @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
177
+
178
+ */
179
+ removeFile(filePath: string, normalizePath?: boolean): void;
180
+ /**
181
+ * Remove all files from the program that are in the specified folder path (recursive)
182
+ * @param folderSrcPath The absolute path to the folder on disk
183
+ * @param normalizePath should the provided path be normalized before use?
168
184
  */
169
- removeFile(pathAbsolute: string): void;
185
+ removeFilesInFolder(folderSrcPath: string, normalizePath?: boolean): void;
170
186
  /**
171
187
  * Traverse the entire project, and validate all scopes
172
188
  * @param force - if true, then all scopes are force to validate, even if they aren't marked as dirty
@@ -182,9 +198,10 @@ export declare class Program {
182
198
  private fileIsIncludedInAnyScope;
183
199
  /**
184
200
  * Get the file at the given path
185
- * @param pathAbsolute
201
+ * @param filePath can be a srcPath, a pkgPath, or a destPath (same as pkgPath but without `pkg:/`)
202
+ * @param normalizePath should this function repair and standardize the path? Passing false should have a performance boost if you can guarantee your path is already sanitized
186
203
  */
187
- private getFile;
204
+ getFile<T extends BscFile>(filePath: string, normalizePath?: boolean): T;
188
205
  /**
189
206
  * Get a list of all scopes the file is loaded into
190
207
  * @param file
@@ -194,29 +211,41 @@ export declare class Program {
194
211
  getStatementsForXmlFile(scope: XmlScope, filterName?: string): FileLink<FunctionStatement>[];
195
212
  /**
196
213
  * Find all available completion items at the given position
197
- * @param pathAbsolute
214
+ * @param srcPath The absolute path to the source file on disk
198
215
  * @param lineIndex
199
216
  * @param columnIndex
200
217
  */
201
- getCompletions(pathAbsolute: string, position: Position): CompletionItem[];
218
+ getCompletions(srcPath: string, position: Position): CompletionItem[];
202
219
  /**
203
220
  * Goes through each file and builds a list of workspace symbols for the program. Used by LanguageServer's onWorkspaceSymbol functionality
204
221
  */
205
- getWorkspaceSymbols(): import("vscode-languageserver-types").SymbolInformation[];
222
+ getWorkspaceSymbols(): SymbolInformation[];
206
223
  /**
207
224
  * Given a position in a file, if the position is sitting on some type of identifier,
208
225
  * go to the definition of that identifier (where this thing was first defined)
226
+ * @param srcPath The absolute path to the source file on disk
209
227
  */
210
- getDefinition(pathAbsolute: string, position: Position): Location[];
211
- getHover(pathAbsolute: string, position: Position): Promise<import("vscode-languageserver-types").Hover>;
228
+ getDefinition(srcPath: string, position: Position): Location[];
229
+ /**
230
+ * @param srcPath The absolute path to the source file on disk
231
+ */
232
+ getHover(srcPath: string, position: Position): Promise<import("vscode-languageserver-types").Hover>;
212
233
  /**
213
234
  * Compute code actions for the given file and range
235
+ * @param srcPath The absolute path to the source file on disk
236
+ */
237
+ getCodeActions(srcPath: string, range: Range): CodeAction[];
238
+ /**
239
+ * Get semantic tokens for the specified file
214
240
  */
215
- getCodeActions(pathAbsolute: string, range: Range): CodeAction[];
241
+ getSemanticTokens(srcPath: string): SemanticToken[];
216
242
  getSignatureHelp(filepath: string, position: Position): SignatureInfoObj[];
217
243
  private getPartialStatementInfo;
218
244
  private getPartialItemCounts;
219
- getReferences(pathAbsolute: string, position: Position): Location[] | Promise<Location[]>;
245
+ /**
246
+ * @param srcPath The absolute path to the source file on disk
247
+ */
248
+ getReferences(srcPath: string, position: Position): Location[] | Promise<Location[]>;
220
249
  /**
221
250
  * Get a list of all script imports, relative to the specified pkgPath
222
251
  * @param sourcePkgPath - the pkgPath of the source that wants to resolve script imports.
@@ -225,9 +254,10 @@ export declare class Program {
225
254
  /**
226
255
  * Transpile a single file and get the result as a string.
227
256
  * This does not write anything to the file system.
257
+ * @param srcPath The absolute path to the source file on disk
228
258
  */
229
- getTranspiledFileContents(pathAbsolute: string): {
230
- pathAbsolute: string;
259
+ getTranspiledFileContents(srcPath: string): {
260
+ srcPath: string;
231
261
  pkgPath: string;
232
262
  code: string;
233
263
  map: import("source-map").SourceMapGenerator;
@@ -236,15 +266,15 @@ export declare class Program {
236
266
  /**
237
267
  * Find a list of files in the program that have a function with the given name (case INsensitive)
238
268
  */
239
- findFilesForFunction(functionName: string): (BrsFile | XmlFile)[];
269
+ findFilesForFunction(functionName: string): BscFile[];
240
270
  /**
241
271
  * Find a list of files in the program that have a function with the given name (case INsensitive)
242
272
  */
243
- findFilesForClass(className: string): (BrsFile | XmlFile)[];
273
+ findFilesForClass(className: string): BscFile[];
244
274
  /**
245
275
  * Get a map of the manifest information
246
276
  */
247
- getManifest(): Map<string, string | number | boolean>;
277
+ getManifest(): Map<string, ManifestValue>;
248
278
  private _manifest;
249
279
  dispose(): void;
250
280
  }