Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from May 19, 2019

Conversation

andrewbranch
Copy link
Contributor

Fixes #932

@@ -187,13 +187,14 @@ function provideErrorsToWebpack(
? constants.dtsTsTsxJsJsxRegex
: constants.dtsTsTsxRegex;

// I’m pretty sure this will never be undefined here
const program = ensureProgram(instance);
Copy link
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 😁

? [
...languageService!.getSyntacticDiagnostics(filePath),
...languageService!.getSemanticDiagnostics(filePath)
]
Copy link
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
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
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