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

efix(extension): Allow requests to reach the language server when in c… #2067

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

atscott
Copy link
Collaborator

@atscott atscott commented Jul 16, 2024

…omponent decorator

This commit updates the early-return logic on the client-side to allow requests to go to the server whenever the cursor is inside the component decorator. Prior to this change, some requests would attempt to return early if the position was not inside the inline template region. However, we were never able to get the tokenizing working correctly and this has led to issues whenever there are multiple template strings (JS template strings with `).

This approach should give us the needed benefits of early-returns in non-Angular contexts (@Component decorator should be pretty rare) while being more permissive and correct.

fixes #2064

@atscott atscott requested a review from devversion July 16, 2024 21:05
@atscott atscott added the target: patch This PR is targeted for the next patch release label Jul 16, 2024
isInsideInlineTemplateRegion(document, range.start) &&
isInsideInlineTemplateRegion(document, range.end)) {
isInsideComponentDecorator(document, range.start) &&
isInsideComponentDecorator(document, range.end)) {
Copy link
Member

Choose a reason for hiding this comment

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

The function seems to also return for HTML files, but the name only suggests "inside decorator". Wondering if we can rename, but otherwise LGTM.

…omponent decorator

This commit updates the early-return logic on the client-side to allow
requests to go to the server whenever the cursor is inside the component
decorator. Prior to this change, some requests would attempt to return
early if the position was not inside the inline template region.
However, we were never able to get the tokenizing working correctly and
this has led to issues whenever there are multiple template strings
(JS template strings with \`).

This approach should give us the needed benefits of early-returns in
non-Angular contexts (`@Component` decorator should be pretty rare) while
being more permissive and correct.

fixes angular#2064
@atscott atscott added the action: merge Ready to merge label Jul 19, 2024
@atscott atscott merged commit 48a800f into angular:main Jul 19, 2024
5 checks passed
atscott added a commit that referenced this pull request Jul 19, 2024
…omponent decorator (#2067)

This commit updates the early-return logic on the client-side to allow
requests to go to the server whenever the cursor is inside the component
decorator. Prior to this change, some requests would attempt to return
early if the position was not inside the inline template region.
However, we were never able to get the tokenizing working correctly and
this has led to issues whenever there are multiple template strings
(JS template strings with \`).

This approach should give us the needed benefits of early-returns in
non-Angular contexts (`@Component` decorator should be pretty rare) while
being more permissive and correct.

fixes #2064

(cherry picked from commit 48a800f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge Ready to merge target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quick info stops working if there are two components in the same file and I change a field in parent component
2 participants