Skip to content

fix: LS not showing existing diagnostics on file open #966

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

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

kyliau
Copy link
Contributor

@kyliau kyliau commented Nov 9, 2020

This commit fixes a bug whereby existing diagnostics in an external template
are not shown when the file is opened the first time. Diagnostics only show
up when subsequent edits are made to the file.
This is a regression after upgrading to TS 4.0

Fix #922

This commit fixes a bug whereby existing diagnostics in an external template
are not shown when the file is opened the first time. Diagnostics only show
up when subsequent edits are made to the file.
This is a regression after upgrading to TS 4.0

Fix angular#922
Copy link
Contributor

@ayazhafiz ayazhafiz left a comment

Choose a reason for hiding this comment

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

Why did this change? Is it to do with externalFiles?

@kyliau
Copy link
Contributor Author

kyliau commented Nov 10, 2020

@ayazhafiz microsoft/TypeScript#37239 changed the implementation of openClientFile such that it no longer returns the configFileName when the opening of a file causes a new project to be created.
We actually saw this behavior earlier in #935. While the change is harmless on its own because we already handle subsequent project discovery with ProjectService.getDefaultProjectForScriptInfo(), I overlooked the fact that we also trigger diagnostics on file open. We should not return early when configFileName is absent. Instead we should work around it by looking at the containingProjects of the scriptInfo created by the call to openClientFiles().

@kyliau kyliau changed the title fix: LS not showing existing diagnotics on file open fix: LS not showing existing diagnostics on file open Nov 10, 2020
@kyliau kyliau merged commit 1583781 into angular:master Nov 10, 2020
@kyliau kyliau deleted the open-client-file branch November 10, 2020 01:27
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in HTML not reported on file open
3 participants