Skip to content

Fix missing error output in root project with project references#937

Merged
andrewbranch merged 3 commits intoTypeStrong:masterfrom
andrewbranch:bug/project-refs-errors
May 19, 2019
Merged

Fix missing error output in root project with project references#937
andrewbranch merged 3 commits intoTypeStrong:masterfrom
andrewbranch:bug/project-refs-errors

Conversation

@andrewbranch
Copy link
Copy Markdown
Contributor

Fixes #932

@andrewbranch andrewbranch requested a review from johnnyreilly May 18, 2019 22:29
Comment thread src/after-compile.ts
: constants.dtsTsTsxRegex;

// I’m pretty sure this will never be undefined here
const program = ensureProgram(instance);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust you dude 😁

Comment thread src/after-compile.ts
? [
...languageService!.getSyntacticDiagnostics(filePath),
...languageService!.getSemanticDiagnostics(filePath)
]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, can you recall why we used to alternate between languageService and program here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@johnnyreilly
Copy link
Copy Markdown
Member

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:

@andrewbranch andrewbranch merged commit 18151d5 into TypeStrong:master May 19, 2019
@andrewbranch andrewbranch deleted the bug/project-refs-errors branch May 19, 2019 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No Errors Displayed with Project References

2 participants