ts-patch icon indicating copy to clipboard operation
ts-patch copied to clipboard

When `"composite": true` specified in `tsconfig.json`, `extras.diagnostics` becomes an empty array

Open pucelle opened this issue 1 year ago • 1 comments

I don't know if this is an issue. I can get all the extras.diagnostics after changes composite to false.

In addition, I noticed when work with ts-loader, extras.diagnostics becomes empty too, while using tspc command is OK.

I also find when work with tspc -w, same issue happens.

pucelle avatar Oct 23 '24 01:10 pucelle

I have found the reason of this issue:

The patch of watch.ts, function

function emitFilesAndReportErrors<T extends BuilderProgram>(program: Program | T, ...)

When compile with tspc directly, program parameter is Program type, but when compile with tspc -w, program parameter is BuilderProgram type.

I can confirm to fix this issue by patching with tsp.diagnosticMap.set(program.getProgram ? program.getProgram() : program, allDiagnostics), but since I'm not familiar with typescript source codes, I would not give a pull request.

pucelle avatar Nov 10 '24 12:11 pucelle