-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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): Correctly parse inputs and selectors with dollar signs #44268
Conversation
2deabf5
to
095dd79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Oh, there is a word missing between "Correctly" and "inputs" in the commit message!
095dd79
to
f255411
Compare
…ar signs When we are going to the definition of an input, we find _both_ the definition of the input _and_ also look for any directives which have a selector that matches the input. For example: ``` @directive({ selector: '[greeting]' }) export class MyDir { @input() greeting!: string; } ``` With this commit, we now correctly handle the case where inputs and/or selectors have a dollar sign in them. The dollar sign has special meaning in CSS, but when we encounter the dollar in a template, we need to escape it when used as a selector so that it is taken as a dollar literal rather than a character with special meaning. Previously, we were not escaping the dollar sign and the CSS parsing logic would throw an error. The change in this commit prevents that error from happening, but a `try...catch` is still added in case there is another unhandled use-case. If this happens, we do not want the `goToDefinition` operation to completely fail. Fixes angular/vscode-ng-language-service#1574
f255411
to
c4b176d
Compare
merge assistance: unrelated test failures (legacy saucelabs) |
This PR was merged into the repository by commit 3aafa76. |
…ar signs (#44268) When we are going to the definition of an input, we find _both_ the definition of the input _and_ also look for any directives which have a selector that matches the input. For example: ``` @directive({ selector: '[greeting]' }) export class MyDir { @input() greeting!: string; } ``` With this commit, we now correctly handle the case where inputs and/or selectors have a dollar sign in them. The dollar sign has special meaning in CSS, but when we encounter the dollar in a template, we need to escape it when used as a selector so that it is taken as a dollar literal rather than a character with special meaning. Previously, we were not escaping the dollar sign and the CSS parsing logic would throw an error. The change in this commit prevents that error from happening, but a `try...catch` is still added in case there is another unhandled use-case. If this happens, we do not want the `goToDefinition` operation to completely fail. Fixes angular/vscode-ng-language-service#1574 PR Close #44268
…ar signs (angular#44268) When we are going to the definition of an input, we find _both_ the definition of the input _and_ also look for any directives which have a selector that matches the input. For example: ``` @directive({ selector: '[greeting]' }) export class MyDir { @input() greeting!: string; } ``` With this commit, we now correctly handle the case where inputs and/or selectors have a dollar sign in them. The dollar sign has special meaning in CSS, but when we encounter the dollar in a template, we need to escape it when used as a selector so that it is taken as a dollar literal rather than a character with special meaning. Previously, we were not escaping the dollar sign and the CSS parsing logic would throw an error. The change in this commit prevents that error from happening, but a `try...catch` is still added in case there is another unhandled use-case. If this happens, we do not want the `goToDefinition` operation to completely fail. Fixes angular/vscode-ng-language-service#1574 PR Close angular#44268
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. |
When we are going to the definition of an input, we find both the
definition of the input and also look for any directives which have
a selector that matches the input. For example:
With this commit, we now correctly handle the case where inputs and/or
selectors have a dollar sign in them. The dollar sign has special
meaning in CSS, but when we encounter the dollar in a template, we need
to escape it when used as a selector so that it is taken as a dollar
literal rather than a character with special meaning.
Previously, we were not escaping the dollar sign and the CSS parsing
logic would throw an error. The change in this commit prevents that
error from happening, but a
try...catch
is still added in case thereis another unhandled use-case. If this happens, we do not want the
goToDefinition
operation to completely fail.Fixes angular/vscode-ng-language-service#1574