Fix missing error output in root project with project references#937
Conversation
| : constants.dtsTsTsxRegex; | ||
|
|
||
| // I’m pretty sure this will never be undefined here | ||
| const program = ensureProgram(instance); |
| ? [ | ||
| ...languageService!.getSyntacticDiagnostics(filePath), | ||
| ...languageService!.getSemanticDiagnostics(filePath) | ||
| ] |
There was a problem hiding this comment.
Just out of curiosity, can you recall why we used to alternate between languageService and program here?
There was a problem hiding this comment.
To clarify, these lines weren't the issue, I just updated them for consistency with the changes above, which were the issue.
languageService.get*Diagnostics() essentially just calls its internal program.get*Diagnostics(). Based on loader options (and I honestly can't remember what options produce what scenarios), we either have a program directly (instance.program) or a language service which has a program under the hood (instance.languageService.getProgram()). Before, we were branching here in this function based on where the underlying program is. But, we already have a util—ensureProgram—that does that branching.
TL;DR: these lines are basically equivalent because of ensureProgram; the lines above should have been looking at both program and languageService but were only looking at program.
|
I'm about to head to bed - the UK has come last in the Eurovision song contest. Clearly I am shellshocked 🙄🙈🙉 Feel free to merge when you're ready. 😀 If you wanted to push out the release you're welcome to; it's simple, just:
|
Fixes #932