-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(extension): Allow requests to reach the language server when in c…
…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
- Loading branch information
Showing
5 changed files
with
46 additions
and
76 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{{title | uppercase}} | ||
<span class="subtitle"> | ||
subtitle | ||
{{sig()}} | ||
{{x.sig()}} | ||
</span> | ||
<lib-post></lib-post> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, signal } from '@angular/core'; | ||
|
||
@Component({ | ||
templateUrl: 'foo.component.html', | ||
}) | ||
export class FooComponent { | ||
title = 'Foo Component'; | ||
sig = signal(1); | ||
x = { | ||
sig: signal(1), | ||
} | ||
/** returns 1 */ | ||
method() { | ||
return 1; | ||
} | ||
} |