diff --git a/benchmarks/targets/parse-brs.js b/benchmarks/targets/parse-brs.js index 24a0dffc9..58a528fbe 100644 --- a/benchmarks/targets/parse-brs.js +++ b/benchmarks/targets/parse-brs.js @@ -21,7 +21,7 @@ module.exports = async (suite, name, brighterscript, projectPath, options) => { const promises = []; for (const file of files) { promises.push( - builder.program.addOrReplaceFile(file.pkgPath, file.fileContents) + (builder.program.addOrReplaceFile ?? builder.program.setFile)(file.pkgPath, file.fileContents) ); } // eslint-disable-next-line @typescript-eslint/no-floating-promises diff --git a/scripts/compile-doc-examples.ts b/scripts/compile-doc-examples.ts index ca8c5d764..9c512899a 100644 --- a/scripts/compile-doc-examples.ts +++ b/scripts/compile-doc-examples.ts @@ -184,7 +184,7 @@ class DocCompiler { //use the current bsconfig ...(this.bsconfig ?? {}) }); - const file = program.addOrReplaceFile({ src: `${__dirname}/rootDir/source/main.bs`, dest: 'source/main.bs' }, code); + const file = program.setFile({ src: `${__dirname}/rootDir/source/main.bs`, dest: 'source/main.bs' }, code); program.validate(); let tranpileResult = file.transpile(); return tranpileResult.code; diff --git a/src/FunctionScope.spec.ts b/src/FunctionScope.spec.ts index 99f632d63..9ebd3737e 100644 --- a/src/FunctionScope.spec.ts +++ b/src/FunctionScope.spec.ts @@ -23,7 +23,7 @@ describe('FunctionScope', () => { }); it('returns variables defined above the specified line number', () => { - let file = program.addOrReplaceFile({ src: `${rootDir}/source/main.brs`, dest: 'source/main.brs' }, ` + let file = program.setFile({ src: `${rootDir}/source/main.brs`, dest: 'source/main.brs' }, ` sub main() var1 = 1 var2 = 2 diff --git a/src/LanguageServer.spec.ts b/src/LanguageServer.spec.ts index 51d3b501f..96e3dbd9d 100644 --- a/src/LanguageServer.spec.ts +++ b/src/LanguageServer.spec.ts @@ -114,12 +114,12 @@ describe('LanguageServer', () => { ${additionalXmlContents}