Merge pull request #32789 from amcasey/FileNotFoundError

Correct string template
This commit is contained in:
Andrew Casey 2019-08-09 15:16:23 -07:00 committed by GitHub
commit 816e7b0567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -713,7 +713,7 @@ namespace ts.server {
if (err.ProgramFiles) {
msg += `\n\nProgram files: {JSON.stringify(error.ProgramFiles}}\n`;
msg += `\n\nProgram files: ${JSON.stringify(err.ProgramFiles)}\n`;
msg += `\n\nProjects::\n`;
let counter = 0;
const addProjectInfo = (project: Project) => {

View File

@ -1158,7 +1158,7 @@ namespace ts {
function getValidSourceFile(fileName: string): SourceFile {
const sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
const error: Error & PossibleProgramFileInfo = new Error(`Could not find sourceFile: '${fileName}'.`);
const error: Error & PossibleProgramFileInfo = new Error(`Could not find source file: '${fileName}'.`);
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
// See https://github.com/microsoft/TypeScript/issues/30180.

View File

@ -139,7 +139,7 @@ namespace ts.projectSystem {
assert.isTrue(false, `should not find file '${imported.path}'`);
}
catch (e) {
assert.isTrue(e.message.indexOf(`Could not find sourceFile: '${imported.path}'.`) === 0, `Actual: ${e.message}`);
assert.isTrue(e.message.indexOf(`Could not find source file: '${imported.path}'.`) === 0, `Actual: ${e.message}`);
}
const f2Lookups = getLocationsForModuleLookup("f2");
callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, f2Lookups, 1);