brighterscript 0.59.0 → 0.60.0

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 (223) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +5 -4
  3. package/dist/CommentFlagProcessor.d.ts +1 -1
  4. package/dist/CommentFlagProcessor.js +1 -1
  5. package/dist/DependencyGraph.d.ts +3 -2
  6. package/dist/DependencyGraph.js +3 -2
  7. package/dist/DependencyGraph.js.map +1 -1
  8. package/dist/DiagnosticFilterer.js +1 -2
  9. package/dist/DiagnosticFilterer.js.map +1 -1
  10. package/dist/DiagnosticMessages.d.ts +6 -1
  11. package/dist/DiagnosticMessages.js +5 -0
  12. package/dist/DiagnosticMessages.js.map +1 -1
  13. package/dist/FunctionScope.d.ts +1 -1
  14. package/dist/FunctionScope.js +1 -1
  15. package/dist/KeyedThrottler.d.ts +3 -3
  16. package/dist/KeyedThrottler.js +3 -3
  17. package/dist/KeyedThrottler.js.map +1 -1
  18. package/dist/LanguageServer.d.ts +0 -7
  19. package/dist/LanguageServer.js +0 -7
  20. package/dist/LanguageServer.js.map +1 -1
  21. package/dist/Program.d.ts +5 -7
  22. package/dist/Program.js +11 -213
  23. package/dist/Program.js.map +1 -1
  24. package/dist/ProgramBuilder.d.ts +0 -1
  25. package/dist/ProgramBuilder.js +0 -1
  26. package/dist/ProgramBuilder.js.map +1 -1
  27. package/dist/Scope.d.ts +31 -33
  28. package/dist/Scope.js +47 -33
  29. package/dist/Scope.js.map +1 -1
  30. package/dist/SymbolTable.d.ts +0 -3
  31. package/dist/SymbolTable.js +0 -3
  32. package/dist/SymbolTable.js.map +1 -1
  33. package/dist/Watcher.d.ts +0 -3
  34. package/dist/Watcher.js +0 -3
  35. package/dist/Watcher.js.map +1 -1
  36. package/dist/astUtils/AstEditor.d.ts +1 -1
  37. package/dist/astUtils/AstEditor.js +1 -1
  38. package/dist/astUtils/AstEditor.spec.js +58 -58
  39. package/dist/astUtils/AstEditor.spec.js.map +1 -1
  40. package/dist/astUtils/creators.spec.js +5 -5
  41. package/dist/astUtils/creators.spec.js.map +1 -1
  42. package/dist/astUtils/reflection.spec.js +112 -112
  43. package/dist/astUtils/reflection.spec.js.map +1 -1
  44. package/dist/astUtils/stackedVisitor.spec.js +12 -12
  45. package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
  46. package/dist/astUtils/visitors.d.ts +4 -0
  47. package/dist/astUtils/visitors.js +4 -0
  48. package/dist/astUtils/visitors.js.map +1 -1
  49. package/dist/astUtils/visitors.spec.js +21 -21
  50. package/dist/astUtils/visitors.spec.js.map +1 -1
  51. package/dist/bscPlugin/CallExpressionInfo.d.ts +35 -0
  52. package/dist/bscPlugin/CallExpressionInfo.js +131 -0
  53. package/dist/bscPlugin/CallExpressionInfo.js.map +1 -0
  54. package/dist/bscPlugin/SignatureHelpUtil.d.ts +10 -0
  55. package/dist/bscPlugin/SignatureHelpUtil.js +135 -0
  56. package/dist/bscPlugin/SignatureHelpUtil.js.map +1 -0
  57. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +7 -7
  58. package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
  59. package/dist/bscPlugin/hover/HoverProcessor.spec.js +27 -27
  60. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
  61. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +2 -2
  62. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -1
  63. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +1 -2
  64. package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +1 -1
  65. package/dist/bscPlugin/validation/BrsFileValidator.d.ts +1 -0
  66. package/dist/bscPlugin/validation/BrsFileValidator.js +11 -0
  67. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  68. package/dist/bscPlugin/validation/BrsFileValidator.spec.js +39 -9
  69. package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
  70. package/dist/files/BrsFile.Class.spec.js +11 -11
  71. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  72. package/dist/files/BrsFile.d.ts +8 -20
  73. package/dist/files/BrsFile.js +16 -97
  74. package/dist/files/BrsFile.js.map +1 -1
  75. package/dist/files/BrsFile.spec.js +235 -187
  76. package/dist/files/BrsFile.spec.js.map +1 -1
  77. package/dist/files/XmlFile.d.ts +1 -4
  78. package/dist/files/XmlFile.js +1 -4
  79. package/dist/files/XmlFile.js.map +1 -1
  80. package/dist/files/XmlFile.spec.js +82 -82
  81. package/dist/files/XmlFile.spec.js.map +1 -1
  82. package/dist/files/tests/imports.spec.js +7 -7
  83. package/dist/files/tests/imports.spec.js.map +1 -1
  84. package/dist/lexer/Character.spec.js +5 -5
  85. package/dist/lexer/Character.spec.js.map +1 -1
  86. package/dist/lexer/Lexer.d.ts +0 -5
  87. package/dist/lexer/Lexer.js +0 -5
  88. package/dist/lexer/Lexer.js.map +1 -1
  89. package/dist/lexer/Lexer.spec.js +136 -136
  90. package/dist/lexer/Lexer.spec.js.map +1 -1
  91. package/dist/parser/AstNode.d.ts +1 -1
  92. package/dist/parser/AstNode.spec.js +3 -3
  93. package/dist/parser/AstNode.spec.js.map +1 -1
  94. package/dist/parser/Expression.js.map +1 -1
  95. package/dist/parser/Parser.Class.spec.js +60 -60
  96. package/dist/parser/Parser.Class.spec.js.map +1 -1
  97. package/dist/parser/Parser.d.ts +4 -4
  98. package/dist/parser/Parser.js +4 -7
  99. package/dist/parser/Parser.js.map +1 -1
  100. package/dist/parser/Parser.spec.js +229 -221
  101. package/dist/parser/Parser.spec.js.map +1 -1
  102. package/dist/parser/SGParser.spec.js +14 -14
  103. package/dist/parser/SGParser.spec.js.map +1 -1
  104. package/dist/parser/Statement.d.ts +3 -2
  105. package/dist/parser/Statement.js +12 -5
  106. package/dist/parser/Statement.js.map +1 -1
  107. package/dist/parser/Statement.spec.js +29 -11
  108. package/dist/parser/Statement.spec.js.map +1 -1
  109. package/dist/parser/tests/controlFlow/For.spec.js +15 -15
  110. package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
  111. package/dist/parser/tests/controlFlow/ForEach.spec.js +13 -13
  112. package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
  113. package/dist/parser/tests/controlFlow/If.spec.js +93 -93
  114. package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
  115. package/dist/parser/tests/controlFlow/While.spec.js +12 -12
  116. package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
  117. package/dist/parser/tests/expression/Additive.spec.js +8 -8
  118. package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
  119. package/dist/parser/tests/expression/ArrayLiterals.spec.js +26 -26
  120. package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
  121. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +27 -27
  122. package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
  123. package/dist/parser/tests/expression/Boolean.spec.js +8 -8
  124. package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
  125. package/dist/parser/tests/expression/Call.spec.js +45 -45
  126. package/dist/parser/tests/expression/Call.spec.js.map +1 -1
  127. package/dist/parser/tests/expression/Exponential.spec.js +5 -5
  128. package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
  129. package/dist/parser/tests/expression/Function.spec.js +36 -36
  130. package/dist/parser/tests/expression/Function.spec.js.map +1 -1
  131. package/dist/parser/tests/expression/Indexing.spec.js +29 -29
  132. package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
  133. package/dist/parser/tests/expression/Multiplicative.spec.js +9 -9
  134. package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
  135. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +34 -34
  136. package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
  137. package/dist/parser/tests/expression/PrefixUnary.spec.js +12 -12
  138. package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
  139. package/dist/parser/tests/expression/Primary.spec.js +12 -12
  140. package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
  141. package/dist/parser/tests/expression/Relational.spec.js +13 -13
  142. package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
  143. package/dist/parser/tests/expression/TemplateStringExpression.spec.js +10 -10
  144. package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
  145. package/dist/parser/tests/expression/TernaryExpression.spec.js +53 -53
  146. package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
  147. package/dist/parser/tests/statement/AssignmentOperators.spec.js +15 -15
  148. package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
  149. package/dist/parser/tests/statement/ConstStatement.spec.js +6 -6
  150. package/dist/parser/tests/statement/ConstStatement.spec.js.map +1 -1
  151. package/dist/parser/tests/statement/Continue.spec.js +4 -4
  152. package/dist/parser/tests/statement/Continue.spec.js.map +1 -1
  153. package/dist/parser/tests/statement/Declaration.spec.js +19 -19
  154. package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
  155. package/dist/parser/tests/statement/Dim.spec.js +22 -22
  156. package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
  157. package/dist/parser/tests/statement/Enum.spec.js +14 -14
  158. package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
  159. package/dist/parser/tests/statement/Function.spec.js +35 -35
  160. package/dist/parser/tests/statement/Function.spec.js.map +1 -1
  161. package/dist/parser/tests/statement/Goto.spec.js +5 -5
  162. package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
  163. package/dist/parser/tests/statement/Increment.spec.js +20 -20
  164. package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
  165. package/dist/parser/tests/statement/LibraryStatement.spec.js +11 -11
  166. package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
  167. package/dist/parser/tests/statement/Misc.spec.js +20 -20
  168. package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
  169. package/dist/parser/tests/statement/PrintStatement.spec.js +16 -16
  170. package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
  171. package/dist/parser/tests/statement/ReturnStatement.spec.js +9 -9
  172. package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
  173. package/dist/parser/tests/statement/Set.spec.js +22 -22
  174. package/dist/parser/tests/statement/Set.spec.js.map +1 -1
  175. package/dist/parser/tests/statement/Stop.spec.js +6 -6
  176. package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
  177. package/dist/parser/tests/statement/Throw.spec.js +6 -6
  178. package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
  179. package/dist/parser/tests/statement/TryCatch.spec.js +15 -15
  180. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  181. package/dist/preprocessor/Manifest.spec.js +8 -8
  182. package/dist/preprocessor/Manifest.spec.js.map +1 -1
  183. package/dist/preprocessor/Preprocessor.d.ts +2 -2
  184. package/dist/preprocessor/Preprocessor.js +2 -2
  185. package/dist/preprocessor/Preprocessor.spec.js +25 -25
  186. package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
  187. package/dist/preprocessor/PreprocessorParser.d.ts +1 -1
  188. package/dist/preprocessor/PreprocessorParser.js +1 -1
  189. package/dist/preprocessor/PreprocessorParser.spec.js +13 -13
  190. package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
  191. package/dist/types/ArrayType.spec.js +9 -9
  192. package/dist/types/ArrayType.spec.js.map +1 -1
  193. package/dist/types/BooleanType.spec.js +3 -3
  194. package/dist/types/BooleanType.spec.js.map +1 -1
  195. package/dist/types/DoubleType.spec.js +3 -3
  196. package/dist/types/DoubleType.spec.js.map +1 -1
  197. package/dist/types/DynamicType.d.ts +0 -1
  198. package/dist/types/DynamicType.js +0 -1
  199. package/dist/types/DynamicType.js.map +1 -1
  200. package/dist/types/DynamicType.spec.js +3 -3
  201. package/dist/types/DynamicType.spec.js.map +1 -1
  202. package/dist/types/FloatType.spec.js +3 -3
  203. package/dist/types/FloatType.spec.js.map +1 -1
  204. package/dist/types/FunctionType.spec.js +6 -6
  205. package/dist/types/FunctionType.spec.js.map +1 -1
  206. package/dist/types/IntegerType.spec.js +3 -3
  207. package/dist/types/IntegerType.spec.js.map +1 -1
  208. package/dist/types/InterfaceType.spec.js +8 -8
  209. package/dist/types/InterfaceType.spec.js.map +1 -1
  210. package/dist/types/InvalidType.spec.js +3 -3
  211. package/dist/types/InvalidType.spec.js.map +1 -1
  212. package/dist/types/LongIntegerType.spec.js +3 -3
  213. package/dist/types/LongIntegerType.spec.js.map +1 -1
  214. package/dist/types/ObjectType.spec.js +3 -3
  215. package/dist/types/ObjectType.spec.js.map +1 -1
  216. package/dist/types/StringType.spec.js +3 -3
  217. package/dist/types/StringType.spec.js.map +1 -1
  218. package/dist/types/VoidType.spec.js +3 -3
  219. package/dist/types/VoidType.spec.js.map +1 -1
  220. package/dist/util.d.ts +21 -43
  221. package/dist/util.js +26 -54
  222. package/dist/util.js.map +1 -1
  223. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const chai_1 = require("chai");
3
+ const chai_config_spec_1 = require("../chai-config.spec");
4
4
  const sinonImport = require("sinon");
5
5
  const vscode_languageserver_1 = require("vscode-languageserver");
6
6
  const Program_1 = require("../Program");
@@ -80,17 +80,17 @@ describe('BrsFile', () => {
80
80
  });
81
81
  it('sets needsTranspiled to true for .bs files', () => {
82
82
  //BrightScript
83
- (0, chai_1.expect)(new BrsFile_1.BrsFile(`${testHelpers_spec_2.rootDir}/source/main.brs`, 'source/main.brs', program).needsTranspiled).to.be.false;
83
+ (0, chai_config_spec_1.expect)(new BrsFile_1.BrsFile(`${testHelpers_spec_2.rootDir}/source/main.brs`, 'source/main.brs', program).needsTranspiled).to.be.false;
84
84
  //BrighterScript
85
- (0, chai_1.expect)(new BrsFile_1.BrsFile(`${testHelpers_spec_2.rootDir}/source/main.bs`, 'source/main.bs', program).needsTranspiled).to.be.true;
85
+ (0, chai_config_spec_1.expect)(new BrsFile_1.BrsFile(`${testHelpers_spec_2.rootDir}/source/main.bs`, 'source/main.bs', program).needsTranspiled).to.be.true;
86
86
  });
87
87
  it('computes new import statements after clearing parser references', () => {
88
88
  const file = program.setFile('source/main.bs', ``);
89
- (0, chai_1.expect)(file.ownScriptImports).to.be.empty;
89
+ (0, chai_config_spec_1.expect)(file.ownScriptImports).to.be.empty;
90
90
  file.parser.ast.statements.push(new Statement_1.ImportStatement((0, creators_1.createToken)(TokenKind_1.TokenKind.Import), (0, creators_1.createToken)(TokenKind_1.TokenKind.StringLiteral, 'pkg:/source/lib.brs')));
91
- (0, chai_1.expect)(file.ownScriptImports).to.be.empty;
91
+ (0, chai_config_spec_1.expect)(file.ownScriptImports).to.be.empty;
92
92
  file.parser.invalidateReferences();
93
- (0, chai_1.expect)(file.ownScriptImports.map(x => x.text)).to.eql(['pkg:/source/lib.brs']);
93
+ (0, chai_config_spec_1.expect)(file.ownScriptImports.map(x => x.text)).to.eql(['pkg:/source/lib.brs']);
94
94
  });
95
95
  it('allows adding diagnostics', () => {
96
96
  const expected = [{
@@ -108,19 +108,19 @@ describe('BrsFile', () => {
108
108
  };
109
109
  it('creates proper tokens', () => {
110
110
  file = program.setFile(entry, `call(ModuleA.ModuleB.ModuleC.`);
111
- (0, chai_1.expect)(file['getPartialVariableName'](file.parser.tokens[7])).to.equal('ModuleA.ModuleB.ModuleC.');
112
- (0, chai_1.expect)(file['getPartialVariableName'](file.parser.tokens[6])).to.equal('ModuleA.ModuleB.ModuleC');
113
- (0, chai_1.expect)(file['getPartialVariableName'](file.parser.tokens[5])).to.equal('ModuleA.ModuleB.');
114
- (0, chai_1.expect)(file['getPartialVariableName'](file.parser.tokens[4])).to.equal('ModuleA.ModuleB');
115
- (0, chai_1.expect)(file['getPartialVariableName'](file.parser.tokens[3])).to.equal('ModuleA.');
116
- (0, chai_1.expect)(file['getPartialVariableName'](file.parser.tokens[2])).to.equal('ModuleA');
111
+ (0, chai_config_spec_1.expect)(file['getPartialVariableName'](file.parser.tokens[7])).to.equal('ModuleA.ModuleB.ModuleC.');
112
+ (0, chai_config_spec_1.expect)(file['getPartialVariableName'](file.parser.tokens[6])).to.equal('ModuleA.ModuleB.ModuleC');
113
+ (0, chai_config_spec_1.expect)(file['getPartialVariableName'](file.parser.tokens[5])).to.equal('ModuleA.ModuleB.');
114
+ (0, chai_config_spec_1.expect)(file['getPartialVariableName'](file.parser.tokens[4])).to.equal('ModuleA.ModuleB');
115
+ (0, chai_config_spec_1.expect)(file['getPartialVariableName'](file.parser.tokens[3])).to.equal('ModuleA.');
116
+ (0, chai_config_spec_1.expect)(file['getPartialVariableName'](file.parser.tokens[2])).to.equal('ModuleA');
117
117
  });
118
118
  });
119
119
  describe('getScopesForFile', () => {
120
120
  it('finds the scope for the file', () => {
121
121
  var _a;
122
122
  let file = program.setFile('source/main.brs', ``);
123
- (0, chai_1.expect)((_a = program.getScopesForFile(file)[0]) === null || _a === void 0 ? void 0 : _a.name).to.equal('source');
123
+ (0, chai_config_spec_1.expect)((_a = program.getScopesForFile(file)[0]) === null || _a === void 0 ? void 0 : _a.name).to.equal('source');
124
124
  });
125
125
  });
126
126
  describe('getCompletions', () => {
@@ -130,7 +130,7 @@ describe('BrsFile', () => {
130
130
  getManager()@.
131
131
  end sub
132
132
  `);
133
- (0, chai_1.expect)(() => {
133
+ (0, chai_config_spec_1.expect)(() => {
134
134
  program.getCompletions(file.srcPath, util_1.default.createPosition(2, 34));
135
135
  }).not.to.throw;
136
136
  });
@@ -142,7 +142,7 @@ describe('BrsFile', () => {
142
142
  `);
143
143
  const result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 31));
144
144
  const names = result.map(x => x.label);
145
- (0, chai_1.expect)(names.sort()).to.eql([
145
+ (0, chai_config_spec_1.expect)(names.sort()).to.eql([
146
146
  'pkg:/source/main.brs'
147
147
  ]);
148
148
  });
@@ -154,7 +154,7 @@ describe('BrsFile', () => {
154
154
  `);
155
155
  const result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 31));
156
156
  const names = result.map(x => x.label);
157
- (0, chai_1.expect)(names.sort()).to.eql([
157
+ (0, chai_config_spec_1.expect)(names.sort()).to.eql([
158
158
  'libpkg:/source/main.brs'
159
159
  ]);
160
160
  });
@@ -166,7 +166,7 @@ describe('BrsFile', () => {
166
166
  `);
167
167
  const result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 31));
168
168
  const names = result.map(x => x.label);
169
- (0, chai_1.expect)(names.sort()).to.eql([
169
+ (0, chai_config_spec_1.expect)(names.sort()).to.eql([
170
170
  'pkg:/source/main.brs'
171
171
  ]);
172
172
  });
@@ -183,8 +183,8 @@ describe('BrsFile', () => {
183
183
  `);
184
184
  let result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(3, 23));
185
185
  let names = result.map(x => x.label);
186
- (0, chai_1.expect)(names).to.includes('Main');
187
- (0, chai_1.expect)(names).to.includes('SayHello');
186
+ (0, chai_config_spec_1.expect)(names).to.includes('Main');
187
+ (0, chai_config_spec_1.expect)(names).to.includes('SayHello');
188
188
  });
189
189
  it('includes every type of item at base level', () => {
190
190
  program.setFile('source/main.bs', `
@@ -231,9 +231,9 @@ describe('BrsFile', () => {
231
231
  end class
232
232
  `);
233
233
  const result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.bs`, vscode_languageserver_1.Position.create(2, 24)).map(x => x.label);
234
- (0, chai_1.expect)(result).includes('main');
235
- (0, chai_1.expect)(result).includes('foo');
236
- (0, chai_1.expect)(result).includes('Person');
234
+ (0, chai_config_spec_1.expect)(result).includes('main');
235
+ (0, chai_config_spec_1.expect)(result).includes('foo');
236
+ (0, chai_config_spec_1.expect)(result).includes('Person');
237
237
  });
238
238
  it('gets namespace completions', () => {
239
239
  program.setFile('source/main.bs', `
@@ -250,10 +250,10 @@ describe('BrsFile', () => {
250
250
  `);
251
251
  let result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.bs`, vscode_languageserver_1.Position.create(8, 30));
252
252
  let names = result.map(x => x.label);
253
- (0, chai_1.expect)(names).to.includes('bar');
253
+ (0, chai_config_spec_1.expect)(names).to.includes('bar');
254
254
  result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.bs`, vscode_languageserver_1.Position.create(9, 32));
255
255
  names = result.map(x => x.label);
256
- (0, chai_1.expect)(names).to.includes('sayHello');
256
+ (0, chai_config_spec_1.expect)(names).to.includes('sayHello');
257
257
  });
258
258
  });
259
259
  it('always includes `m`', () => {
@@ -265,12 +265,12 @@ describe('BrsFile', () => {
265
265
  `);
266
266
  let result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 23));
267
267
  let names = result.map(x => x.label);
268
- (0, chai_1.expect)(names).to.contain('m');
268
+ (0, chai_config_spec_1.expect)(names).to.contain('m');
269
269
  });
270
270
  it('does not fail for missing previousToken', () => {
271
271
  //add a single character to the file, and get completions after it
272
272
  program.setFile('source/main.brs', `i`);
273
- (0, chai_1.expect)(() => {
273
+ (0, chai_config_spec_1.expect)(() => {
274
274
  program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(0, 1)).map(x => x.label);
275
275
  }).not.to.throw;
276
276
  });
@@ -286,13 +286,13 @@ describe('BrsFile', () => {
286
286
  let result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 23));
287
287
  let names = result.map(x => x.label);
288
288
  for (let keyword of keywords) {
289
- (0, chai_1.expect)(names).to.include(keyword);
289
+ (0, chai_config_spec_1.expect)(names).to.include(keyword);
290
290
  }
291
291
  //outside the function
292
292
  result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(4, 8));
293
293
  names = result.map(x => x.label);
294
294
  for (let keyword of keywords) {
295
- (0, chai_1.expect)(names).to.include(keyword);
295
+ (0, chai_config_spec_1.expect)(names).to.include(keyword);
296
296
  }
297
297
  });
298
298
  it('does not provide completions within a comment', () => {
@@ -304,7 +304,7 @@ describe('BrsFile', () => {
304
304
  `);
305
305
  //inside the function
306
306
  let result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 33));
307
- (0, chai_1.expect)(result).to.be.lengthOf(0);
307
+ (0, chai_config_spec_1.expect)(result).to.be.lengthOf(0);
308
308
  });
309
309
  it('does not provide duplicate entries for variables', () => {
310
310
  //eslint-disable-next-line @typescript-eslint/no-floating-promises
@@ -319,7 +319,7 @@ describe('BrsFile', () => {
319
319
  let count = result.reduce((total, x) => {
320
320
  return x.label === 'name' ? total + 1 : total;
321
321
  }, 0);
322
- (0, chai_1.expect)(count).to.equal(1);
322
+ (0, chai_config_spec_1.expect)(count).to.equal(1);
323
323
  });
324
324
  it('does not include `as` and `string` text options when used in function params', () => {
325
325
  //eslint-disable-next-line @typescript-eslint/no-floating-promises
@@ -329,8 +329,8 @@ describe('BrsFile', () => {
329
329
  end sub
330
330
  `);
331
331
  let result = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 23));
332
- (0, chai_1.expect)(result.filter(x => x.kind === vscode_languageserver_1.CompletionItemKind.Text)).not.to.contain('as');
333
- (0, chai_1.expect)(result.filter(x => x.kind === vscode_languageserver_1.CompletionItemKind.Text)).not.to.contain('string');
332
+ (0, chai_config_spec_1.expect)(result.filter(x => x.kind === vscode_languageserver_1.CompletionItemKind.Text)).not.to.contain('as');
333
+ (0, chai_config_spec_1.expect)(result.filter(x => x.kind === vscode_languageserver_1.CompletionItemKind.Text)).not.to.contain('string');
334
334
  });
335
335
  it('does not provide intellisense results when inside a comment', () => {
336
336
  //eslint-disable-next-line @typescript-eslint/no-floating-promises
@@ -340,7 +340,7 @@ describe('BrsFile', () => {
340
340
  end sub
341
341
  `);
342
342
  let results = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(2, 30));
343
- (0, chai_1.expect)(results).to.be.empty;
343
+ (0, chai_config_spec_1.expect)(results).to.be.empty;
344
344
  });
345
345
  it('does provide intellisence for labels only after a goto keyword', () => {
346
346
  var _a;
@@ -351,8 +351,8 @@ describe('BrsFile', () => {
351
351
  goto \nend sub
352
352
  `);
353
353
  let results = program.getCompletions(`${testHelpers_spec_2.rootDir}/source/main.brs`, vscode_languageserver_1.Position.create(3, 25));
354
- (0, chai_1.expect)(results.length).to.equal(1);
355
- (0, chai_1.expect)((_a = results[0]) === null || _a === void 0 ? void 0 : _a.label).to.equal('something');
354
+ (0, chai_config_spec_1.expect)(results.length).to.equal(1);
355
+ (0, chai_config_spec_1.expect)((_a = results[0]) === null || _a === void 0 ? void 0 : _a.label).to.equal('something');
356
356
  });
357
357
  });
358
358
  describe('comment flags', () => {
@@ -394,8 +394,8 @@ describe('BrsFile', () => {
394
394
  name = "bob
395
395
  end sub
396
396
  `);
397
- (0, chai_1.expect)(file.commentFlags[0]).to.exist;
398
- (0, chai_1.expect)(file.commentFlags[0]).to.deep.include({
397
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.exist;
398
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.deep.include({
399
399
  codes: null,
400
400
  range: vscode_languageserver_1.Range.create(2, 24, 2, 45),
401
401
  affectedRange: util_1.default.createRange(3, 0, 3, Number.MAX_SAFE_INTEGER)
@@ -411,8 +411,8 @@ describe('BrsFile', () => {
411
411
  name = "bob
412
412
  end sub
413
413
  `);
414
- (0, chai_1.expect)(file.commentFlags[0]).to.exist;
415
- (0, chai_1.expect)(file.commentFlags[0]).to.deep.include({
414
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.exist;
415
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.deep.include({
416
416
  codes: [1083, 1001],
417
417
  range: vscode_languageserver_1.Range.create(2, 24, 2, 57),
418
418
  affectedRange: util_1.default.createRange(3, 0, 3, Number.MAX_SAFE_INTEGER)
@@ -427,7 +427,7 @@ describe('BrsFile', () => {
427
427
  name = "bob
428
428
  end sub
429
429
  `);
430
- (0, chai_1.expect)(file.commentFlags[0]).to.exist;
430
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.exist;
431
431
  (0, testHelpers_spec_1.expectHasDiagnostics)(program);
432
432
  });
433
433
  it('supports disabling non-numeric error codes', () => {
@@ -463,8 +463,8 @@ describe('BrsFile', () => {
463
463
  z::;;%%%%%% 'bs:disable-line
464
464
  end sub
465
465
  `);
466
- (0, chai_1.expect)(file.commentFlags[0]).to.exist;
467
- (0, chai_1.expect)(file.commentFlags[0]).to.deep.include({
466
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.exist;
467
+ (0, chai_config_spec_1.expect)(file.commentFlags[0]).to.deep.include({
468
468
  codes: null,
469
469
  range: vscode_languageserver_1.Range.create(2, 36, 2, 52),
470
470
  affectedRange: vscode_languageserver_1.Range.create(2, 0, 2, 36)
@@ -556,7 +556,7 @@ describe('BrsFile', () => {
556
556
  it('uses the proper parse mode based on file extension', () => {
557
557
  function testParseMode(destPath, expectedParseMode) {
558
558
  const file = program.setFile(destPath, '');
559
- (0, chai_1.expect)(file.parseMode).to.equal(expectedParseMode);
559
+ (0, chai_config_spec_1.expect)(file.parseMode).to.equal(expectedParseMode);
560
560
  }
561
561
  testParseMode('source/main.brs', Parser_1.ParseMode.BrightScript);
562
562
  testParseMode('source/main.spec.brs', Parser_1.ParseMode.BrightScript);
@@ -829,7 +829,7 @@ describe('BrsFile', () => {
829
829
  print "hello world"
830
830
  end sub
831
831
  `);
832
- (0, chai_1.expect)(file.functionScopes).to.be.lengthOf(2);
832
+ (0, chai_config_spec_1.expect)(file.functionScopes).to.be.lengthOf(2);
833
833
  });
834
834
  it('does not lose sub scope when mismatched end function', () => {
835
835
  file.parse(`
@@ -841,7 +841,7 @@ describe('BrsFile', () => {
841
841
  print "hello world"
842
842
  end sub
843
843
  `);
844
- (0, chai_1.expect)(file.functionScopes).to.be.lengthOf(2);
844
+ (0, chai_config_spec_1.expect)(file.functionScopes).to.be.lengthOf(2);
845
845
  });
846
846
  it('does not error with boolean in RHS of set statement', () => {
847
847
  file.parse(`
@@ -1113,7 +1113,7 @@ describe('BrsFile', () => {
1113
1113
  return value.subType()
1114
1114
  end function
1115
1115
  `);
1116
- (0, chai_1.expect)(file.callables[0]).to.deep.include({
1116
+ (0, chai_config_spec_1.expect)(file.callables[0]).to.deep.include({
1117
1117
  file: file,
1118
1118
  nameRange: vscode_languageserver_1.Range.create(1, 25, 1, 36)
1119
1119
  });
@@ -1136,17 +1136,17 @@ describe('BrsFile', () => {
1136
1136
  print "B"
1137
1137
  end function
1138
1138
  `);
1139
- (0, chai_1.expect)(file.callables[0].name).to.equal('DoA');
1140
- (0, chai_1.expect)(file.callables[0].nameRange).to.eql(vscode_languageserver_1.Range.create(1, 25, 1, 28));
1141
- (0, chai_1.expect)(file.callables[1].name).to.equal('DoB');
1142
- (0, chai_1.expect)(file.callables[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 26, 5, 29));
1139
+ (0, chai_config_spec_1.expect)(file.callables[0].name).to.equal('DoA');
1140
+ (0, chai_config_spec_1.expect)(file.callables[0].nameRange).to.eql(vscode_languageserver_1.Range.create(1, 25, 1, 28));
1141
+ (0, chai_config_spec_1.expect)(file.callables[1].name).to.equal('DoB');
1142
+ (0, chai_config_spec_1.expect)(file.callables[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 26, 5, 29));
1143
1143
  });
1144
1144
  it('throws an error if the file has already been parsed', () => {
1145
1145
  let file = new BrsFile_1.BrsFile('abspath', 'relpath', program);
1146
1146
  file.parse(`'a comment`);
1147
1147
  try {
1148
1148
  file.parse(`'a new comment`);
1149
- chai_1.assert.fail(null, null, 'Should have thrown an exception, but did not');
1149
+ chai_config_spec_1.assert.fail(null, null, 'Should have thrown an exception, but did not');
1150
1150
  }
1151
1151
  catch (e) {
1152
1152
  //test passes
@@ -1163,11 +1163,11 @@ describe('BrsFile', () => {
1163
1163
  print "A"
1164
1164
  end function
1165
1165
  `);
1166
- (0, chai_1.expect)(file.callables.length).to.equal(2);
1167
- (0, chai_1.expect)(file.callables[0].name).to.equal('DoA');
1168
- (0, chai_1.expect)(file.callables[0].nameRange.start.line).to.equal(1);
1169
- (0, chai_1.expect)(file.callables[1].name).to.equal('DoA');
1170
- (0, chai_1.expect)(file.callables[1].nameRange.start.line).to.equal(5);
1166
+ (0, chai_config_spec_1.expect)(file.callables.length).to.equal(2);
1167
+ (0, chai_config_spec_1.expect)(file.callables[0].name).to.equal('DoA');
1168
+ (0, chai_config_spec_1.expect)(file.callables[0].nameRange.start.line).to.equal(1);
1169
+ (0, chai_config_spec_1.expect)(file.callables[1].name).to.equal('DoA');
1170
+ (0, chai_config_spec_1.expect)(file.callables[1].nameRange.start.line).to.equal(5);
1171
1171
  });
1172
1172
  it('finds function call line and column numbers', () => {
1173
1173
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1179,11 +1179,11 @@ describe('BrsFile', () => {
1179
1179
  DoC()
1180
1180
  end function
1181
1181
  `);
1182
- (0, chai_1.expect)(file.functionCalls.length).to.equal(2);
1183
- (0, chai_1.expect)(file.functionCalls[0].range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 28));
1184
- (0, chai_1.expect)(file.functionCalls[0].nameRange).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 23));
1185
- (0, chai_1.expect)(file.functionCalls[1].range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 25));
1186
- (0, chai_1.expect)(file.functionCalls[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 23));
1182
+ (0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(2);
1183
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 28));
1184
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].nameRange).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 23));
1185
+ (0, chai_config_spec_1.expect)(file.functionCalls[1].range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 25));
1186
+ (0, chai_config_spec_1.expect)(file.functionCalls[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 23));
1187
1187
  });
1188
1188
  it('finds function calls that are unfinished', () => {
1189
1189
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1202,11 +1202,11 @@ describe('BrsFile', () => {
1202
1202
  DiagnosticMessages_1.DiagnosticMessages.expectedRightParenAfterFunctionCallArguments(),
1203
1203
  DiagnosticMessages_1.DiagnosticMessages.expectedNewlineOrColon()
1204
1204
  ]);
1205
- (0, chai_1.expect)(file.functionCalls.length).to.equal(2);
1206
- (0, chai_1.expect)(file.functionCalls[0].range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 27));
1207
- (0, chai_1.expect)(file.functionCalls[0].nameRange).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 23));
1208
- (0, chai_1.expect)(file.functionCalls[1].range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 24));
1209
- (0, chai_1.expect)(file.functionCalls[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 23));
1205
+ (0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(2);
1206
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 27));
1207
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].nameRange).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 23));
1208
+ (0, chai_config_spec_1.expect)(file.functionCalls[1].range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 24));
1209
+ (0, chai_config_spec_1.expect)(file.functionCalls[1].nameRange).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 23));
1210
1210
  });
1211
1211
  it('sanitizes brs errors', () => {
1212
1212
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1215,8 +1215,8 @@ describe('BrsFile', () => {
1215
1215
  end function
1216
1216
  `);
1217
1217
  (0, testHelpers_spec_1.expectHasDiagnostics)(file);
1218
- (0, chai_1.expect)(file.getDiagnostics()[0].file).to.equal(file);
1219
- (0, chai_1.expect)(file.getDiagnostics()[0].range.start.line).to.equal(1);
1218
+ (0, chai_config_spec_1.expect)(file.getDiagnostics()[0].file).to.equal(file);
1219
+ (0, chai_config_spec_1.expect)(file.getDiagnostics()[0].range.start.line).to.equal(1);
1220
1220
  });
1221
1221
  it('supports using the `next` keyword in a for loop', () => {
1222
1222
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1252,7 +1252,7 @@ describe('BrsFile', () => {
1252
1252
  end sub
1253
1253
  `);
1254
1254
  let callable = file.callables[0];
1255
- (0, chai_1.expect)(callable.range).to.eql(vscode_languageserver_1.Range.create(1, 16, 3, 23));
1255
+ (0, chai_config_spec_1.expect)(callable.range).to.eql(vscode_languageserver_1.Range.create(1, 16, 3, 23));
1256
1256
  });
1257
1257
  it('finds correct body range even with inner function', () => {
1258
1258
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1265,7 +1265,7 @@ describe('BrsFile', () => {
1265
1265
  end sub
1266
1266
  `);
1267
1267
  let callable = file.callables[0];
1268
- (0, chai_1.expect)(callable.range).to.eql(vscode_languageserver_1.Range.create(1, 16, 6, 23));
1268
+ (0, chai_config_spec_1.expect)(callable.range).to.eql(vscode_languageserver_1.Range.create(1, 16, 6, 23));
1269
1269
  });
1270
1270
  it('finds callable parameters', () => {
1271
1271
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1275,24 +1275,24 @@ describe('BrsFile', () => {
1275
1275
  end function
1276
1276
  `);
1277
1277
  let callable = file.callables[0];
1278
- (0, chai_1.expect)(callable.params[0]).to.deep.include({
1278
+ (0, chai_config_spec_1.expect)(callable.params[0]).to.deep.include({
1279
1279
  name: 'a',
1280
1280
  isOptional: false,
1281
1281
  isRestArgument: false
1282
1282
  });
1283
- (0, chai_1.expect)(callable.params[0].type).instanceof(DynamicType_1.DynamicType);
1284
- (0, chai_1.expect)(callable.params[1]).to.deep.include({
1283
+ (0, chai_config_spec_1.expect)(callable.params[0].type).instanceof(DynamicType_1.DynamicType);
1284
+ (0, chai_config_spec_1.expect)(callable.params[1]).to.deep.include({
1285
1285
  name: 'b',
1286
1286
  isOptional: false,
1287
1287
  isRestArgument: false
1288
1288
  });
1289
- (0, chai_1.expect)(callable.params[1].type).instanceof(DynamicType_1.DynamicType);
1290
- (0, chai_1.expect)(callable.params[2]).to.deep.include({
1289
+ (0, chai_config_spec_1.expect)(callable.params[1].type).instanceof(DynamicType_1.DynamicType);
1290
+ (0, chai_config_spec_1.expect)(callable.params[2]).to.deep.include({
1291
1291
  name: 'c',
1292
1292
  isOptional: false,
1293
1293
  isRestArgument: false
1294
1294
  });
1295
- (0, chai_1.expect)(callable.params[2].type).instanceof(DynamicType_1.DynamicType);
1295
+ (0, chai_config_spec_1.expect)(callable.params[2].type).instanceof(DynamicType_1.DynamicType);
1296
1296
  });
1297
1297
  it('finds optional parameters', () => {
1298
1298
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1302,12 +1302,12 @@ describe('BrsFile', () => {
1302
1302
  end function
1303
1303
  `);
1304
1304
  let callable = file.callables[0];
1305
- (0, chai_1.expect)(callable.params[0]).to.deep.include({
1305
+ (0, chai_config_spec_1.expect)(callable.params[0]).to.deep.include({
1306
1306
  name: 'a',
1307
1307
  isOptional: true,
1308
1308
  isRestArgument: false
1309
1309
  });
1310
- (0, chai_1.expect)(callable.params[0].type).instanceof(DynamicType_1.DynamicType);
1310
+ (0, chai_config_spec_1.expect)(callable.params[0].type).instanceof(DynamicType_1.DynamicType);
1311
1311
  });
1312
1312
  it('finds parameter types', () => {
1313
1313
  let file = new BrsFile_1.BrsFile('absolute_path/file.brs', 'relative_path/file.brs', program);
@@ -1317,24 +1317,24 @@ describe('BrsFile', () => {
1317
1317
  end function
1318
1318
  `);
1319
1319
  let callable = file.callables[0];
1320
- (0, chai_1.expect)(callable.params[0]).to.deep.include({
1320
+ (0, chai_config_spec_1.expect)(callable.params[0]).to.deep.include({
1321
1321
  name: 'a',
1322
1322
  isOptional: false,
1323
1323
  isRestArgument: false
1324
1324
  });
1325
- (0, chai_1.expect)(callable.params[0].type).instanceof(DynamicType_1.DynamicType);
1326
- (0, chai_1.expect)(callable.params[1]).to.deep.include({
1325
+ (0, chai_config_spec_1.expect)(callable.params[0].type).instanceof(DynamicType_1.DynamicType);
1326
+ (0, chai_config_spec_1.expect)(callable.params[1]).to.deep.include({
1327
1327
  name: 'b',
1328
1328
  isOptional: false,
1329
1329
  isRestArgument: false
1330
1330
  });
1331
- (0, chai_1.expect)(callable.params[1].type).instanceof(IntegerType_1.IntegerType);
1332
- (0, chai_1.expect)(callable.params[2]).to.deep.include({
1331
+ (0, chai_config_spec_1.expect)(callable.params[1].type).instanceof(IntegerType_1.IntegerType);
1332
+ (0, chai_config_spec_1.expect)(callable.params[2]).to.deep.include({
1333
1333
  name: 'c',
1334
1334
  isOptional: false,
1335
1335
  isRestArgument: false
1336
1336
  });
1337
- (0, chai_1.expect)(callable.params[2].type).instanceof(StringType_1.StringType);
1337
+ (0, chai_config_spec_1.expect)(callable.params[2].type).instanceof(StringType_1.StringType);
1338
1338
  });
1339
1339
  });
1340
1340
  describe('findCallableInvocations', () => {
@@ -1345,12 +1345,12 @@ describe('BrsFile', () => {
1345
1345
  DoSomething("name", 12, true)
1346
1346
  end function
1347
1347
  `);
1348
- (0, chai_1.expect)(file.functionCalls.length).to.equal(1);
1348
+ (0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(1);
1349
1349
  const argsMap = file.functionCalls[0].args.map(arg => {
1350
1350
  // disregard arg.expression, etc.
1351
1351
  return { type: arg.type, range: arg.range, text: arg.text };
1352
1352
  });
1353
- (0, chai_1.expect)(argsMap).to.eql([{
1353
+ (0, chai_config_spec_1.expect)(argsMap).to.eql([{
1354
1354
  type: new StringType_1.StringType(),
1355
1355
  range: util_1.default.createRange(2, 32, 2, 38),
1356
1356
  text: '"name"'
@@ -1387,16 +1387,16 @@ describe('BrsFile', () => {
1387
1387
  DoSomething(count, name, isAlive)
1388
1388
  end function
1389
1389
  `);
1390
- (0, chai_1.expect)(file.functionCalls.length).to.equal(1);
1391
- (0, chai_1.expect)(file.functionCalls[0].args[0]).deep.include({
1390
+ (0, chai_config_spec_1.expect)(file.functionCalls.length).to.equal(1);
1391
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].args[0]).deep.include({
1392
1392
  type: new DynamicType_1.DynamicType(),
1393
1393
  text: 'count'
1394
1394
  });
1395
- (0, chai_1.expect)(file.functionCalls[0].args[1]).deep.include({
1395
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].args[1]).deep.include({
1396
1396
  type: new DynamicType_1.DynamicType(),
1397
1397
  text: 'name'
1398
1398
  });
1399
- (0, chai_1.expect)(file.functionCalls[0].args[2]).deep.include({
1399
+ (0, chai_config_spec_1.expect)(file.functionCalls[0].args[2]).deep.include({
1400
1400
  type: new DynamicType_1.DynamicType(),
1401
1401
  text: 'isAlive'
1402
1402
  });
@@ -1407,20 +1407,20 @@ describe('BrsFile', () => {
1407
1407
  it('skips top-level statements', () => {
1408
1408
  let file = new BrsFile_1.BrsFile('absolute', 'relative', program);
1409
1409
  file.parse('name = "Bob"');
1410
- (0, chai_1.expect)(file.callables.length).to.equal(0);
1410
+ (0, chai_config_spec_1.expect)(file.callables.length).to.equal(0);
1411
1411
  });
1412
1412
  it('finds return type', () => {
1413
1413
  let file = program.setFile('source/main.brs', `
1414
1414
  function DoSomething() as string
1415
1415
  end function
1416
1416
  `);
1417
- (0, chai_1.expect)(file.callables[0]).to.deep.include({
1417
+ (0, chai_config_spec_1.expect)(file.callables[0]).to.deep.include({
1418
1418
  file: file,
1419
1419
  nameRange: vscode_languageserver_1.Range.create(1, 25, 1, 36),
1420
1420
  name: 'DoSomething',
1421
1421
  params: []
1422
1422
  });
1423
- (0, chai_1.expect)(file.callables[0].type.returnType).instanceof(StringType_1.StringType);
1423
+ (0, chai_config_spec_1.expect)(file.callables[0].type.returnType).instanceof(StringType_1.StringType);
1424
1424
  });
1425
1425
  });
1426
1426
  describe('createFunctionScopes', () => {
@@ -1430,7 +1430,7 @@ describe('BrsFile', () => {
1430
1430
  name = 'bob"
1431
1431
  end sub
1432
1432
  `);
1433
- (0, chai_1.expect)(file.functionScopes[0].range).to.eql(vscode_languageserver_1.Range.create(1, 16, 3, 23));
1433
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].range).to.eql(vscode_languageserver_1.Range.create(1, 16, 3, 23));
1434
1434
  });
1435
1435
  it('creates scopes for parent and child functions', () => {
1436
1436
  file.parse(`
@@ -1444,7 +1444,7 @@ describe('BrsFile', () => {
1444
1444
  end sub)
1445
1445
  end sub
1446
1446
  `);
1447
- (0, chai_1.expect)(file.functionScopes).to.length(3);
1447
+ (0, chai_config_spec_1.expect)(file.functionScopes).to.length(3);
1448
1448
  });
1449
1449
  it('outer function does not capture inner statements', () => {
1450
1450
  file.parse(`
@@ -1456,9 +1456,9 @@ describe('BrsFile', () => {
1456
1456
  end sub
1457
1457
  `);
1458
1458
  let outerScope = file.getFunctionScopeAtPosition(vscode_languageserver_1.Position.create(2, 25));
1459
- (0, chai_1.expect)(outerScope.variableDeclarations).to.be.lengthOf(2);
1459
+ (0, chai_config_spec_1.expect)(outerScope.variableDeclarations).to.be.lengthOf(2);
1460
1460
  let innerScope = file.getFunctionScopeAtPosition(vscode_languageserver_1.Position.create(4, 10));
1461
- (0, chai_1.expect)(innerScope.variableDeclarations).to.be.lengthOf(1);
1461
+ (0, chai_config_spec_1.expect)(innerScope.variableDeclarations).to.be.lengthOf(1);
1462
1462
  });
1463
1463
  it('finds variables declared in function scopes', () => {
1464
1464
  file.parse(`
@@ -1472,24 +1472,24 @@ describe('BrsFile', () => {
1472
1472
  end sub)
1473
1473
  end sub
1474
1474
  `);
1475
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations).to.be.length(1);
1476
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations[0]).to.deep.include({
1475
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations).to.be.length(1);
1476
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations[0]).to.deep.include({
1477
1477
  lineIndex: 2,
1478
1478
  name: 'sayHi'
1479
1479
  });
1480
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations[0].type).instanceof(FunctionType_1.FunctionType);
1481
- (0, chai_1.expect)(file.functionScopes[1].variableDeclarations).to.be.length(1);
1482
- (0, chai_1.expect)(file.functionScopes[1].variableDeclarations[0]).to.deep.include({
1480
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations[0].type).instanceof(FunctionType_1.FunctionType);
1481
+ (0, chai_config_spec_1.expect)(file.functionScopes[1].variableDeclarations).to.be.length(1);
1482
+ (0, chai_config_spec_1.expect)(file.functionScopes[1].variableDeclarations[0]).to.deep.include({
1483
1483
  lineIndex: 3,
1484
1484
  name: 'age'
1485
1485
  });
1486
- (0, chai_1.expect)(file.functionScopes[1].variableDeclarations[0].type).instanceof(IntegerType_1.IntegerType);
1487
- (0, chai_1.expect)(file.functionScopes[2].variableDeclarations).to.be.length(1);
1488
- (0, chai_1.expect)(file.functionScopes[2].variableDeclarations[0]).to.deep.include({
1486
+ (0, chai_config_spec_1.expect)(file.functionScopes[1].variableDeclarations[0].type).instanceof(IntegerType_1.IntegerType);
1487
+ (0, chai_config_spec_1.expect)(file.functionScopes[2].variableDeclarations).to.be.length(1);
1488
+ (0, chai_config_spec_1.expect)(file.functionScopes[2].variableDeclarations[0]).to.deep.include({
1489
1489
  lineIndex: 7,
1490
1490
  name: 'name'
1491
1491
  });
1492
- (0, chai_1.expect)(file.functionScopes[2].variableDeclarations[0].type).instanceof(StringType_1.StringType);
1492
+ (0, chai_config_spec_1.expect)(file.functionScopes[2].variableDeclarations[0].type).instanceof(StringType_1.StringType);
1493
1493
  });
1494
1494
  it('finds variable declarations inside of if statements', () => {
1495
1495
  file.parse(`
@@ -1500,8 +1500,8 @@ describe('BrsFile', () => {
1500
1500
  end sub
1501
1501
  `);
1502
1502
  let scope = file.getFunctionScopeAtPosition(vscode_languageserver_1.Position.create(3, 0));
1503
- (0, chai_1.expect)(scope.variableDeclarations[0]).to.exist;
1504
- (0, chai_1.expect)(scope.variableDeclarations[0].name).to.equal('theLength');
1503
+ (0, chai_config_spec_1.expect)(scope.variableDeclarations[0]).to.exist;
1504
+ (0, chai_config_spec_1.expect)(scope.variableDeclarations[0].name).to.equal('theLength');
1505
1505
  });
1506
1506
  it('finds value from global return', () => {
1507
1507
  let file = program.setFile('source/main.brs', `
@@ -1513,12 +1513,12 @@ describe('BrsFile', () => {
1513
1513
  return "bob"
1514
1514
  end function
1515
1515
  `);
1516
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations).to.be.length(1);
1517
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations[0]).to.deep.include({
1516
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations).to.be.length(1);
1517
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations[0]).to.deep.include({
1518
1518
  lineIndex: 2,
1519
1519
  name: 'myName'
1520
1520
  });
1521
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations[0].type).instanceof(StringType_1.StringType);
1521
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations[0].type).instanceof(StringType_1.StringType);
1522
1522
  });
1523
1523
  it('finds variable type from other variable', () => {
1524
1524
  file.parse(`
@@ -1527,12 +1527,12 @@ describe('BrsFile', () => {
1527
1527
  nameCopy = name
1528
1528
  end sub
1529
1529
  `);
1530
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations).to.be.length(2);
1531
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations[1]).to.deep.include({
1530
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations).to.be.length(2);
1531
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations[1]).to.deep.include({
1532
1532
  lineIndex: 3,
1533
1533
  name: 'nameCopy'
1534
1534
  });
1535
- (0, chai_1.expect)(file.functionScopes[0].variableDeclarations[1].type).instanceof(StringType_1.StringType);
1535
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].variableDeclarations[1].type).instanceof(StringType_1.StringType);
1536
1536
  });
1537
1537
  it('sets proper range for functions', () => {
1538
1538
  file.parse(`
@@ -1542,9 +1542,9 @@ describe('BrsFile', () => {
1542
1542
  end function
1543
1543
  end sub
1544
1544
  `);
1545
- (0, chai_1.expect)(file.functionScopes).to.be.length(2);
1546
- (0, chai_1.expect)(file.functionScopes[0].range).to.eql(vscode_languageserver_1.Range.create(1, 16, 5, 23));
1547
- (0, chai_1.expect)(file.functionScopes[1].range).to.eql(vscode_languageserver_1.Range.create(2, 30, 4, 32));
1545
+ (0, chai_config_spec_1.expect)(file.functionScopes).to.be.length(2);
1546
+ (0, chai_config_spec_1.expect)(file.functionScopes[0].range).to.eql(vscode_languageserver_1.Range.create(1, 16, 5, 23));
1547
+ (0, chai_config_spec_1.expect)(file.functionScopes[1].range).to.eql(vscode_languageserver_1.Range.create(2, 30, 4, 32));
1548
1548
  });
1549
1549
  });
1550
1550
  it('handles mixed case `then` partions of conditionals', () => {
@@ -1555,7 +1555,7 @@ describe('BrsFile', () => {
1555
1555
  end if
1556
1556
  end sub
1557
1557
  `);
1558
- (0, chai_1.expect)(mainFile.getDiagnostics()).to.be.lengthOf(0);
1558
+ (0, chai_config_spec_1.expect)(mainFile.getDiagnostics()).to.be.lengthOf(0);
1559
1559
  mainFile = program.setFile('source/main.brs', `
1560
1560
  sub Main()
1561
1561
  if true Then
@@ -1563,7 +1563,7 @@ describe('BrsFile', () => {
1563
1563
  end if
1564
1564
  end sub
1565
1565
  `);
1566
- (0, chai_1.expect)(mainFile.getDiagnostics()).to.be.lengthOf(0);
1566
+ (0, chai_config_spec_1.expect)(mainFile.getDiagnostics()).to.be.lengthOf(0);
1567
1567
  mainFile = program.setFile('source/main.brs', `
1568
1568
  sub Main()
1569
1569
  if true THEN
@@ -1571,7 +1571,7 @@ describe('BrsFile', () => {
1571
1571
  end if
1572
1572
  end sub
1573
1573
  `);
1574
- (0, chai_1.expect)(mainFile.getDiagnostics()).to.be.lengthOf(0);
1574
+ (0, chai_config_spec_1.expect)(mainFile.getDiagnostics()).to.be.lengthOf(0);
1575
1575
  });
1576
1576
  describe('getHover', () => {
1577
1577
  it('works for param types', () => {
@@ -1584,12 +1584,12 @@ describe('BrsFile', () => {
1584
1584
  `);
1585
1585
  //hover over the `name = 1` line
1586
1586
  let hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 24))[0];
1587
- (0, chai_1.expect)(hover).to.exist;
1588
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 24));
1587
+ (0, chai_config_spec_1.expect)(hover).to.exist;
1588
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 24));
1589
1589
  //hover over the `name` parameter declaration
1590
1590
  hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(1, 34))[0];
1591
- (0, chai_1.expect)(hover).to.exist;
1592
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(1, 32, 1, 36));
1591
+ (0, chai_config_spec_1.expect)(hover).to.exist;
1592
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(1, 32, 1, 36));
1593
1593
  });
1594
1594
  //ignore this for now...it's not a huge deal
1595
1595
  it('does not match on keywords or data types', () => {
@@ -1600,9 +1600,9 @@ describe('BrsFile', () => {
1600
1600
  end sub
1601
1601
  `);
1602
1602
  //hover over the `as`
1603
- (0, chai_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(1, 31))).to.be.empty;
1603
+ (0, chai_config_spec_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(1, 31))).to.be.empty;
1604
1604
  //hover over the `string`
1605
- (0, chai_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(1, 36))).to.be.empty;
1605
+ (0, chai_config_spec_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(1, 36))).to.be.empty;
1606
1606
  });
1607
1607
  it('finds declared function', () => {
1608
1608
  let file = program.setFile('source/main.brs', `
@@ -1613,9 +1613,9 @@ describe('BrsFile', () => {
1613
1613
  end function
1614
1614
  `);
1615
1615
  let hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(1, 28))[0];
1616
- (0, chai_1.expect)(hover).to.exist;
1617
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(1, 25, 1, 29));
1618
- (0, chai_1.expect)(hover.contents).to.equal([
1616
+ (0, chai_config_spec_1.expect)(hover).to.exist;
1617
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(1, 25, 1, 29));
1618
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1619
1619
  '```brightscript',
1620
1620
  'function Main(count? as dynamic) as dynamic',
1621
1621
  '```'
@@ -1632,9 +1632,9 @@ describe('BrsFile', () => {
1632
1632
  end namespace
1633
1633
  `);
1634
1634
  let hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 28))[0];
1635
- (0, chai_1.expect)(hover).to.exist;
1636
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 25, 2, 29));
1637
- (0, chai_1.expect)(hover.contents).to.equal([
1635
+ (0, chai_config_spec_1.expect)(hover).to.exist;
1636
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 25, 2, 29));
1637
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1638
1638
  '```brightscript',
1639
1639
  'function Main(count? as dynamic) as dynamic',
1640
1640
  '```'
@@ -1650,8 +1650,8 @@ describe('BrsFile', () => {
1650
1650
  end sub
1651
1651
  `);
1652
1652
  let hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(5, 24))[0];
1653
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 29));
1654
- (0, chai_1.expect)(hover.contents).to.equal([
1653
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(5, 20, 5, 29));
1654
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1655
1655
  '```brightscript',
1656
1656
  'sub sayMyName(name as string) as void',
1657
1657
  '```'
@@ -1663,7 +1663,7 @@ describe('BrsFile', () => {
1663
1663
  return ucase(text)
1664
1664
  end function
1665
1665
  `);
1666
- (0, chai_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 30))[0].contents).to.equal([
1666
+ (0, chai_config_spec_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 30))[0].contents).to.equal([
1667
1667
  '```brightscript',
1668
1668
  'function UCase(s as string) as string',
1669
1669
  '```'
@@ -1675,7 +1675,7 @@ describe('BrsFile', () => {
1675
1675
  return url.instr(text)
1676
1676
  end function
1677
1677
  `);
1678
- (0, chai_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 35))[0].contents).to.equal([
1678
+ (0, chai_config_spec_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 35))[0].contents).to.equal([
1679
1679
  '```brightscript',
1680
1680
  //TODO this really shouldn't be returning the global function, but it does...so make sure it doesn't crash right now.
1681
1681
  'function Instr(start as integer, text as string, substring as string) as integer',
@@ -1693,8 +1693,8 @@ describe('BrsFile', () => {
1693
1693
  end sub
1694
1694
  `);
1695
1695
  let hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(2, 25))[0];
1696
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 29));
1697
- (0, chai_1.expect)(hover.contents).to.equal([
1696
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 29));
1697
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1698
1698
  '```brightscript',
1699
1699
  'sub sayMyName() as void',
1700
1700
  '```'
@@ -1713,8 +1713,8 @@ describe('BrsFile', () => {
1713
1713
  end namespace
1714
1714
  `);
1715
1715
  let hover = program.getHover(file.srcPath, vscode_languageserver_1.Position.create(3, 25))[0];
1716
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(3, 20, 3, 29));
1717
- (0, chai_1.expect)(hover.contents).to.equal([
1716
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(3, 20, 3, 29));
1717
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1718
1718
  '```brightscript',
1719
1719
  'sub sayMyName() as void',
1720
1720
  '```'
@@ -1736,9 +1736,9 @@ describe('BrsFile', () => {
1736
1736
  end sub
1737
1737
  `);
1738
1738
  let hover = program.getHover(mainFile.srcPath, vscode_languageserver_1.Position.create(2, 25))[0];
1739
- (0, chai_1.expect)(hover).to.exist;
1740
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 29));
1741
- (0, chai_1.expect)(hover.contents).to.equal([
1739
+ (0, chai_config_spec_1.expect)(hover).to.exist;
1740
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 20, 2, 29));
1741
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1742
1742
  '```brightscript',
1743
1743
  'sub sayMyName(name as string) as void',
1744
1744
  '```'
@@ -1761,9 +1761,9 @@ describe('BrsFile', () => {
1761
1761
  end namespace
1762
1762
  `);
1763
1763
  let hover = program.getHover(mainFile.srcPath, vscode_languageserver_1.Position.create(2, 34))[0];
1764
- (0, chai_1.expect)(hover).to.exist;
1765
- (0, chai_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 28, 2, 37));
1766
- (0, chai_1.expect)(hover.contents).to.equal([
1764
+ (0, chai_config_spec_1.expect)(hover).to.exist;
1765
+ (0, chai_config_spec_1.expect)(hover.range).to.eql(vscode_languageserver_1.Range.create(2, 28, 2, 37));
1766
+ (0, chai_config_spec_1.expect)(hover.contents).to.equal([
1767
1767
  '```brightscript',
1768
1768
  'sub sayMyName(name as string) as void',
1769
1769
  '```'
@@ -1791,7 +1791,7 @@ describe('BrsFile', () => {
1791
1791
  end sub
1792
1792
  `);
1793
1793
  //hover over log("hello")
1794
- (0, chai_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(5, 22))[0].contents).to.equal([
1794
+ (0, chai_config_spec_1.expect)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(5, 22))[0].contents).to.equal([
1795
1795
  '```brightscript',
1796
1796
  'sub log(message as string) as void',
1797
1797
  '```',
@@ -1802,7 +1802,7 @@ describe('BrsFile', () => {
1802
1802
  ''
1803
1803
  ].join('\n'));
1804
1804
  //hover over sub ma|in()
1805
- (0, chai_1.expect)((0, testHelpers_spec_1.trim)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(4, 22))[0].contents.toString())).to.equal((0, testHelpers_spec_1.trim) `
1805
+ (0, chai_config_spec_1.expect)((0, testHelpers_spec_1.trim)(program.getHover(file.srcPath, vscode_languageserver_1.Position.create(4, 22))[0].contents.toString())).to.equal((0, testHelpers_spec_1.trim) `
1806
1806
  \`\`\`brightscript
1807
1807
  sub main() as void
1808
1808
  \`\`\`
@@ -2267,8 +2267,8 @@ describe('BrsFile', () => {
2267
2267
  bias: source_map_1.SourceMapConsumer.LEAST_UPPER_BOUND
2268
2268
  });
2269
2269
  });
2270
- (0, chai_1.expect)(location.line).to.eql(2);
2271
- (0, chai_1.expect)(location.column).eql(4);
2270
+ (0, chai_config_spec_1.expect)(location.line).to.eql(2);
2271
+ (0, chai_config_spec_1.expect)(location.column).eql(4);
2272
2272
  });
2273
2273
  it('computes correct locations for sourcemap', async () => {
2274
2274
  let source = `function abc(name)\n firstName = name\nend function`;
@@ -2296,7 +2296,7 @@ describe('BrsFile', () => {
2296
2296
  originalPosition.line - 1, originalPosition.column)
2297
2297
  };
2298
2298
  });
2299
- (0, chai_1.expect)(sourcemapResult).to.eql(tokenResult);
2299
+ (0, chai_config_spec_1.expect)(sourcemapResult).to.eql(tokenResult);
2300
2300
  });
2301
2301
  });
2302
2302
  it('handles empty if block', () => {
@@ -2352,6 +2352,18 @@ describe('BrsFile', () => {
2352
2352
  end sub
2353
2353
  `);
2354
2354
  });
2355
+ it('handles else block with a leading comment', () => {
2356
+ testTranspile(`
2357
+ sub main()
2358
+ if true then
2359
+ print "if"
2360
+ else
2361
+ ' leading comment
2362
+ print "else"
2363
+ end if
2364
+ end sub
2365
+ `);
2366
+ });
2355
2367
  it('works for function parameters', () => {
2356
2368
  testTranspile(`
2357
2369
  function DoSomething(name, age as integer, text as string)
@@ -2502,7 +2514,7 @@ describe('BrsFile', () => {
2502
2514
  `);
2503
2515
  file.needsTranspiled = false;
2504
2516
  const { code } = file.transpile();
2505
- (0, chai_1.expect)(code.endsWith(`'//# sourceMappingURL=./logger.brs.map`)).to.be.true;
2517
+ (0, chai_config_spec_1.expect)(code.endsWith(`'//# sourceMappingURL=./logger.brs.map`)).to.be.true;
2506
2518
  });
2507
2519
  it('AST generated files include a reference to the source map', () => {
2508
2520
  let file = program.setFile('source/logger.brs', (0, testHelpers_spec_1.trim) `
@@ -2511,7 +2523,7 @@ describe('BrsFile', () => {
2511
2523
  `);
2512
2524
  file.needsTranspiled = true;
2513
2525
  const { code } = file.transpile();
2514
- (0, chai_1.expect)(code.endsWith(`'//# sourceMappingURL=./logger.brs.map`)).to.be.true;
2526
+ (0, chai_config_spec_1.expect)(code.endsWith(`'//# sourceMappingURL=./logger.brs.map`)).to.be.true;
2515
2527
  });
2516
2528
  it('replaces custom types in parameter types and return types', () => {
2517
2529
  program.setFile('source/SomeKlass.bs', `
@@ -2594,29 +2606,29 @@ describe('BrsFile', () => {
2594
2606
  print "hello world"
2595
2607
  end sub
2596
2608
  `);
2597
- (0, chai_1.expect)(file.extension).to.equal(ext);
2609
+ (0, chai_config_spec_1.expect)(file.extension).to.equal(ext);
2598
2610
  return file;
2599
2611
  }
2600
2612
  it('called for BRS file', () => {
2601
2613
  const onParsed = sinon.spy();
2602
2614
  parseFileWithCallback('.brs', onParsed);
2603
- (0, chai_1.expect)(onParsed.callCount).to.equal(1);
2615
+ (0, chai_config_spec_1.expect)(onParsed.callCount).to.equal(1);
2604
2616
  });
2605
2617
  it('called for BR file', () => {
2606
2618
  const onParsed = sinon.spy();
2607
2619
  parseFileWithCallback('.bs', onParsed);
2608
- (0, chai_1.expect)(onParsed.callCount).to.equal(1);
2620
+ (0, chai_config_spec_1.expect)(onParsed.callCount).to.equal(1);
2609
2621
  });
2610
2622
  });
2611
2623
  describe('typedefKey', () => {
2612
2624
  it('works for .brs files', () => {
2613
- (0, chai_1.expect)((0, util_1.standardizePath)((program.setFile('source/main.brs', '')).typedefKey)).to.equal((0, util_1.standardizePath) `${testHelpers_spec_2.rootDir.toLowerCase()}/source/main.d.bs`);
2625
+ (0, chai_config_spec_1.expect)((0, util_1.standardizePath)((program.setFile('source/main.brs', '')).typedefKey)).to.equal((0, util_1.standardizePath) `${testHelpers_spec_2.rootDir.toLowerCase()}/source/main.d.bs`);
2614
2626
  });
2615
2627
  it('returns undefined for files that should not have a typedef', () => {
2616
- (0, chai_1.expect)((program.setFile('source/main.bs', '')).typedefKey).to.be.undefined;
2617
- (0, chai_1.expect)((program.setFile('source/main.d.bs', '')).typedefKey).to.be.undefined;
2628
+ (0, chai_config_spec_1.expect)((program.setFile('source/main.bs', '')).typedefKey).to.be.undefined;
2629
+ (0, chai_config_spec_1.expect)((program.setFile('source/main.d.bs', '')).typedefKey).to.be.undefined;
2618
2630
  const xmlFile = program.setFile('components/comp.xml', '');
2619
- (0, chai_1.expect)(xmlFile.typedefKey).to.be.undefined;
2631
+ (0, chai_config_spec_1.expect)(xmlFile.typedefKey).to.be.undefined;
2620
2632
  });
2621
2633
  });
2622
2634
  describe('type definitions', () => {
@@ -2634,8 +2646,8 @@ describe('BrsFile', () => {
2634
2646
  `);
2635
2647
  const sourceScope = program.getScopeByName('source');
2636
2648
  const functionNames = sourceScope.getAllCallables().map(x => x.callable.name);
2637
- (0, chai_1.expect)(functionNames).to.include('main');
2638
- (0, chai_1.expect)(functionNames).not.to.include('speak');
2649
+ (0, chai_config_spec_1.expect)(functionNames).to.include('main');
2650
+ (0, chai_config_spec_1.expect)(functionNames).not.to.include('speak');
2639
2651
  });
2640
2652
  it('reacts to typedef file changes', () => {
2641
2653
  let file = program.setFile('source/main.brs', `
@@ -2644,14 +2656,14 @@ describe('BrsFile', () => {
2644
2656
  sub speak()
2645
2657
  end sub
2646
2658
  `);
2647
- (0, chai_1.expect)(file.hasTypedef).to.be.false;
2648
- (0, chai_1.expect)(file.typedefFile).not.to.exist;
2659
+ (0, chai_config_spec_1.expect)(file.hasTypedef).to.be.false;
2660
+ (0, chai_config_spec_1.expect)(file.typedefFile).not.to.exist;
2649
2661
  program.setFile('source/main.d.bs', `
2650
2662
  sub main()
2651
2663
  end sub
2652
2664
  `);
2653
- (0, chai_1.expect)(file.hasTypedef).to.be.true;
2654
- (0, chai_1.expect)(file.typedefFile).to.exist;
2665
+ (0, chai_config_spec_1.expect)(file.hasTypedef).to.be.true;
2666
+ (0, chai_config_spec_1.expect)(file.typedefFile).to.exist;
2655
2667
  //add replace file, does it still find the typedef
2656
2668
  file = program.setFile('source/main.brs', `
2657
2669
  sub main()
@@ -2659,47 +2671,47 @@ describe('BrsFile', () => {
2659
2671
  sub speak()
2660
2672
  end sub
2661
2673
  `);
2662
- (0, chai_1.expect)(file.hasTypedef).to.be.true;
2663
- (0, chai_1.expect)(file.typedefFile).to.exist;
2674
+ (0, chai_config_spec_1.expect)(file.hasTypedef).to.be.true;
2675
+ (0, chai_config_spec_1.expect)(file.typedefFile).to.exist;
2664
2676
  program.removeFile((0, util_1.standardizePath) `${testHelpers_spec_2.rootDir}/source/main.d.bs`);
2665
- (0, chai_1.expect)(file.hasTypedef).to.be.false;
2666
- (0, chai_1.expect)(file.typedefFile).not.to.exist;
2677
+ (0, chai_config_spec_1.expect)(file.hasTypedef).to.be.false;
2678
+ (0, chai_config_spec_1.expect)(file.typedefFile).not.to.exist;
2667
2679
  });
2668
2680
  });
2669
2681
  describe('typedef', () => {
2670
2682
  it('sets typedef path properly', () => {
2671
- (0, chai_1.expect)((program.setFile('source/main1.brs', '')).typedefKey).to.equal((0, util_1.standardizePath) `${testHelpers_spec_2.rootDir}/source/main1.d.bs`.toLowerCase());
2672
- (0, chai_1.expect)((program.setFile('source/main2.d.bs', '')).typedefKey).to.equal(undefined);
2673
- (0, chai_1.expect)((program.setFile('source/main3.bs', '')).typedefKey).to.equal(undefined);
2683
+ (0, chai_config_spec_1.expect)((program.setFile('source/main1.brs', '')).typedefKey).to.equal((0, util_1.standardizePath) `${testHelpers_spec_2.rootDir}/source/main1.d.bs`.toLowerCase());
2684
+ (0, chai_config_spec_1.expect)((program.setFile('source/main2.d.bs', '')).typedefKey).to.equal(undefined);
2685
+ (0, chai_config_spec_1.expect)((program.setFile('source/main3.bs', '')).typedefKey).to.equal(undefined);
2674
2686
  //works for dest with `.brs` extension
2675
- (0, chai_1.expect)((program.setFile({ src: 'source/main4.bs', dest: 'source/main4.brs' }, '')).typedefKey).to.equal(undefined);
2687
+ (0, chai_config_spec_1.expect)((program.setFile({ src: 'source/main4.bs', dest: 'source/main4.brs' }, '')).typedefKey).to.equal(undefined);
2676
2688
  });
2677
2689
  it('does not link when missing from program', () => {
2678
2690
  const file = program.setFile('source/main.brs', ``);
2679
- (0, chai_1.expect)(file.typedefFile).not.to.exist;
2691
+ (0, chai_config_spec_1.expect)(file.typedefFile).not.to.exist;
2680
2692
  });
2681
2693
  it('links typedef when added BEFORE .brs file', () => {
2682
2694
  const typedef = program.setFile('source/main.d.bs', ``);
2683
2695
  const file = program.setFile('source/main.brs', ``);
2684
- (0, chai_1.expect)(file.typedefFile).to.equal(typedef);
2696
+ (0, chai_config_spec_1.expect)(file.typedefFile).to.equal(typedef);
2685
2697
  });
2686
2698
  it('links typedef when added AFTER .brs file', () => {
2687
2699
  const file = program.setFile('source/main.brs', ``);
2688
2700
  const typedef = program.setFile('source/main.d.bs', ``);
2689
- (0, chai_1.expect)(file.typedefFile).to.eql(typedef);
2701
+ (0, chai_config_spec_1.expect)(file.typedefFile).to.eql(typedef);
2690
2702
  });
2691
2703
  it('removes typedef link when typedef is removed', () => {
2692
2704
  const typedef = program.setFile('source/main.d.bs', ``);
2693
2705
  const file = program.setFile('source/main.brs', ``);
2694
2706
  program.removeFile(typedef.srcPath);
2695
- (0, chai_1.expect)(file.typedefFile).to.be.undefined;
2707
+ (0, chai_config_spec_1.expect)(file.typedefFile).to.be.undefined;
2696
2708
  });
2697
2709
  });
2698
2710
  describe('getTypedef', () => {
2699
2711
  function testTypedef(original, expected) {
2700
2712
  let file = program.setFile('source/main.brs', original);
2701
2713
  program.validate();
2702
- (0, chai_1.expect)(file.getTypedef().trimEnd()).to.eql(expected);
2714
+ (0, chai_config_spec_1.expect)(file.getTypedef().trimEnd()).to.eql(expected);
2703
2715
  }
2704
2716
  it('includes namespace on extend class names', () => {
2705
2717
  testTypedef(`
@@ -2988,9 +3000,9 @@ describe('BrsFile', () => {
2988
3000
  file['_parser'] = undefined;
2989
3001
  //force the file to get a new instance of parser
2990
3002
  const newParser = file.parser;
2991
- (0, chai_1.expect)(newParser).to.exist.and.to.not.equal(parser);
3003
+ (0, chai_config_spec_1.expect)(newParser).to.exist.and.to.not.equal(parser);
2992
3004
  //reference shouldn't change in subsequent accesses
2993
- (0, chai_1.expect)(file.parser).to.equal(newParser);
3005
+ (0, chai_config_spec_1.expect)(file.parser).to.equal(newParser);
2994
3006
  });
2995
3007
  it('call parse when previously skipped', () => {
2996
3008
  program.setFile('source/main.d.bs', `'typedef
@@ -3002,11 +3014,11 @@ describe('BrsFile', () => {
3002
3014
  end sub
3003
3015
  `);
3004
3016
  //no functions should be found since the parser was skipped
3005
- (0, chai_1.expect)(file['_parser']).to.not.exist;
3017
+ (0, chai_config_spec_1.expect)(file['_parser']).to.not.exist;
3006
3018
  const stub = sinon.stub(file, 'parse').callThrough();
3007
3019
  //`file.parser` is a getter, so that should force the parse to occur
3008
- (0, chai_1.expect)(file.parser.references.functionStatements).to.be.lengthOf(1);
3009
- (0, chai_1.expect)(stub.called).to.be.true;
3020
+ (0, chai_config_spec_1.expect)(file.parser.references.functionStatements).to.be.lengthOf(1);
3021
+ (0, chai_config_spec_1.expect)(stub.called).to.be.true;
3010
3022
  //parse should have been called
3011
3023
  });
3012
3024
  });
@@ -3032,14 +3044,14 @@ describe('BrsFile', () => {
3032
3044
  (0, util_1.standardizePath) `${testHelpers_spec_2.tempDir}/plugins/${pluginFileName}`
3033
3045
  ]), new Logger_1.Logger());
3034
3046
  const file = program.setFile('source/MAIN.brs', '');
3035
- (0, chai_1.expect)(file._customProp).to.exist;
3047
+ (0, chai_config_spec_1.expect)(file._customProp).to.exist;
3036
3048
  });
3037
3049
  it('can load a relative plugin which receives callbacks', () => {
3038
3050
  program.plugins = new PluginInterface_1.default(util_1.default.loadPlugins(testHelpers_spec_2.tempDir, [
3039
3051
  `./plugins/${pluginFileName}`
3040
3052
  ]), new Logger_1.Logger());
3041
3053
  const file = program.setFile('source/MAIN.brs', '');
3042
- (0, chai_1.expect)(file._customProp).to.exist;
3054
+ (0, chai_config_spec_1.expect)(file._customProp).to.exist;
3043
3055
  });
3044
3056
  });
3045
3057
  describe('getDefinition', () => {
@@ -3054,11 +3066,47 @@ describe('BrsFile', () => {
3054
3066
  `);
3055
3067
  program.validate();
3056
3068
  //print alpha.beta.char|lie
3057
- (0, chai_1.expect)(program.getDefinition(file.srcPath, vscode_languageserver_1.Position.create(2, 41))).to.eql([{
3069
+ (0, chai_config_spec_1.expect)(program.getDefinition(file.srcPath, vscode_languageserver_1.Position.create(2, 41))).to.eql([{
3058
3070
  uri: vscode_uri_1.URI.file(file.srcPath).toString(),
3059
3071
  range: util_1.default.createRange(5, 26, 5, 33)
3060
3072
  }]);
3061
3073
  });
3074
+ it('returns enum locations', () => {
3075
+ const file = program.setFile('source/main.bs', `
3076
+ sub main()
3077
+ print alpha.beta.people.charlie
3078
+ end sub
3079
+ namespace alpha.beta
3080
+ enum people
3081
+ charlie = "charles"
3082
+ end enum
3083
+ end namespace
3084
+ `);
3085
+ program.validate();
3086
+ //print alpha.beta.char|lie
3087
+ (0, chai_config_spec_1.expect)(program.getDefinition(file.srcPath, vscode_languageserver_1.Position.create(2, 40))).to.eql([{
3088
+ uri: vscode_uri_1.URI.file(file.srcPath).toString(),
3089
+ range: util_1.default.createRange(5, 25, 5, 31)
3090
+ }]);
3091
+ });
3092
+ it('returns enum member locations', () => {
3093
+ const file = program.setFile('source/main.bs', `
3094
+ sub main()
3095
+ print alpha.beta.people.charlie
3096
+ end sub
3097
+ namespace alpha.beta
3098
+ enum people
3099
+ charlie = "charles"
3100
+ end enum
3101
+ end namespace
3102
+ `);
3103
+ program.validate();
3104
+ //print alpha.beta.char|lie
3105
+ (0, chai_config_spec_1.expect)(program.getDefinition(file.srcPath, vscode_languageserver_1.Position.create(2, 48))).to.eql([{
3106
+ uri: vscode_uri_1.URI.file(file.srcPath).toString(),
3107
+ range: util_1.default.createRange(6, 24, 6, 31)
3108
+ }]);
3109
+ });
3062
3110
  });
3063
3111
  });
3064
3112
  //# sourceMappingURL=BrsFile.spec.js.map