-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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): suggest, not error, on missing context members #35036
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ayazhafiz
added
type: bug/fix
feature
Issue that requests a new feature
area: language-service
Issues related to Angular's VS Code language service
target: patch
This PR is targeted for the next patch release
labels
Jan 29, 2020
The language service reports an error when a directive's template context is missing a member that is being used in a template (e.g. if `$implicit` is being used with a template context typed as `any`). While this diagnostic message is valuable, typing template contexts loosely as `any` or `object` is very widespread in community packages, and often still compiles correctly, so reporting the diagnostic as an error may be misleading to users. This commit changes the diagnostic to be a warning, and adds additional information about how the user can eliminate the warning entirely -- by refining the template context type. Closes angular/vscode-ng-language-service#572
ayazhafiz
force-pushed
the
i/template-context-err
branch
from
January 29, 2020 18:26
db62be6
to
6bbba68
Compare
kyliau
suggested changes
Jan 29, 2020
@kyliau updated screen: |
ayazhafiz
changed the title
fix(language-service): warn, not error, on missing context members
fix(language-service): suggest, not error, on missing context members
Jan 29, 2020
kyliau
approved these changes
Jan 29, 2020
AndrewKushnir
pushed a commit
that referenced
this pull request
Jan 29, 2020
…35036) The language service reports an error when a directive's template context is missing a member that is being used in a template (e.g. if `$implicit` is being used with a template context typed as `any`). While this diagnostic message is valuable, typing template contexts loosely as `any` or `object` is very widespread in community packages, and often still compiles correctly, so reporting the diagnostic as an error may be misleading to users. This commit changes the diagnostic to be a warning, and adds additional information about how the user can eliminate the warning entirely -- by refining the template context type. Closes angular/vscode-ng-language-service#572 PR Close #35036
sonukapoor
pushed a commit
to sonukapoor/angular
that referenced
this pull request
Feb 13, 2020
…ngular#35036) The language service reports an error when a directive's template context is missing a member that is being used in a template (e.g. if `$implicit` is being used with a template context typed as `any`). While this diagnostic message is valuable, typing template contexts loosely as `any` or `object` is very widespread in community packages, and often still compiles correctly, so reporting the diagnostic as an error may be misleading to users. This commit changes the diagnostic to be a warning, and adds additional information about how the user can eliminate the warning entirely -- by refining the template context type. Closes angular/vscode-ng-language-service#572 PR Close angular#35036
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
feature
Issue that requests a new feature
target: patch
This PR is targeted for the next patch release
type: bug/fix
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The language service reports an error when a directive's template
context is missing a member that is being used in a template (e.g. if
$implicit
is being used with a template context typed asany
).While this diagnostic message is valuable, typing template contexts
loosely as
any
orobject
is very widespread in community packages,and often still compiles correctly, so reporting the diagnostic as an
error may be misleading to users.
This commit changes the diagnostic to be a warning, and adds additional
information about how the user can eliminate the warning entirely -- by
refining the template context type.
A screenshot demonstrating the change with VSCode's LSP is attached to
the PR for this commit.
Closes angular/vscode-ng-language-service#572
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?