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(language-service): Clear caches when program changes #21337

Closed
wants to merge 1 commit into from

Conversation

kyliau
Copy link
Contributor

@kyliau kyliau commented Jan 5, 2018

This commit fixes a bug whereby the empty set of analyzed modules is
cached and subsequently produces the incorrect error 'Component ... is
not included in a module...'

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Error message 'Component ... is not included in a module...' is incorrectly shown.

Issue Number: 19405

What is the new behavior?

Language service no longer shows incorrect error message.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@kara kara added the area: language-service Issues related to Angular's VS Code language service label Jan 5, 2018
Copy link
Contributor

@chuckjaz chuckjaz left a comment

Choose a reason for hiding this comment

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

This code looks completely unnecessary to me and, if it has an effect, there is something more fundamental that is going wrong.

The only way analyzedModules should change is if the content of the program changes. Since validate will clear analyzedModules whenever that happens (called before calling ensureAnalyzedModules() the only way this change would have the desired effect is there was something wrong with validate().

@kyliau kyliau changed the title fix(language-service): Do not cache empty analyzed modules fix(language-service): Clear caches when program changes Jan 6, 2018
This commit fixes a bug whereby the caches are not cleared when the
program changes. This subsequently produces the incorrect error of
'Component ... is not included in a module ...'.

PR Close angular#19405
@alexeagle alexeagle added the action: merge The PR is ready for merge by the caretaker label Jan 11, 2018
@ngbot
Copy link

ngbot bot commented Jan 11, 2018

I see that you just added the PR action: merge label. It won't do anything good though, because the following checks are still failing:

  • missing required label: "PR target:"

If you want your PR to be merged, it has to pass all the checks. But if you have a good reason to want to merge this, please contact the caretaker to let them know.

@alexeagle alexeagle added the target: patch This PR is targeted for the next patch release label Jan 11, 2018
alexeagle pushed a commit that referenced this pull request Jan 12, 2018
This commit fixes a bug whereby the caches are not cleared when the
program changes. This subsequently produces the incorrect error of
'Component ... is not included in a module ...'.

PR Close #19405

PR Close #21337
@alexeagle alexeagle closed this in 43e1520 Jan 12, 2018
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
This commit fixes a bug whereby the caches are not cleared when the
program changes. This subsequently produces the incorrect error of
'Component ... is not included in a module ...'.

PR Close angular#19405

PR Close angular#21337
@kyliau kyliau deleted the emptymodules branch August 21, 2018 00:54
@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 Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: language-service Issues related to Angular's VS Code language service cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants