mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Restore logging of the program file list
This commit is contained in:
@@ -711,7 +711,8 @@ namespace ts.server {
|
||||
catch { } // tslint:disable-line no-empty
|
||||
}
|
||||
|
||||
if (err.message && err.message.indexOf(`Could not find sourceFile:`) !== -1) {
|
||||
if (err.hasOwnProperty("ProgramFiles")) {
|
||||
msg += `\n\nProgram files: {(err as any)["ProgramFiles"]}\n`;
|
||||
msg += `\n\nProjects::\n`;
|
||||
let counter = 0;
|
||||
const addProjectInfo = (project: Project) => {
|
||||
|
||||
@@ -1158,7 +1158,12 @@ namespace ts {
|
||||
function getValidSourceFile(fileName: string): SourceFile {
|
||||
const sourceFile = program.getSourceFile(fileName);
|
||||
if (!sourceFile) {
|
||||
throw new Error(`Could not find sourceFile: '${fileName}'.`);
|
||||
let error = new Error(`Could not find sourceFile: '${fileName}'.`);
|
||||
|
||||
// Attach sidecar data for the server log
|
||||
(error as any)["ProgramFiles"] = program && JSON.stringify(program.getSourceFiles().map(f => f.fileName));
|
||||
|
||||
throw error;
|
||||
}
|
||||
return sourceFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user