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

String interpolation before inline template breaks language features #1872

Open
atscott opened this issue Mar 6, 2023 · 1 comment · Fixed by #1922
Open

String interpolation before inline template breaks language features #1872

atscott opened this issue Mar 6, 2023 · 1 comment · Fixed by #1922
Labels

Comments

@atscott
Copy link
Collaborator

atscott commented Mar 6, 2023

🐞 bug report

Is this a regression?

No

Description

Adding a string interpolation before an inline template breaks the language features of the template.

Reproduction

  1. Open a file with an inline template:
    • Hover over a template variable to prove that things are working as expected at the moment (quick info appears for the variable)
  2. Add
const something = `${'xyz'}`;

above the component definition
- Hover over the template variable again. Quick info will not appear

Additional info

It appears that the string interpolation is breaking the TypeScript scanner/tokenizer. The code which checks to see if a location is inside a template region no longer works as a result:

function isPropertyAssignmentToStringOrStringInArray(

@atscott atscott added the bug label Mar 6, 2023
atscott added a commit to atscott/vscode-ng-language-service that referenced this issue Sep 12, 2023
This probably still has its own issues but seems to be at least an improvement over
past scanner issues.

It may be good to spend more time on the correctness of this or just
`ts.createSourceFile`. This previously wasn't done due to perfomance
concerns.

fixes angular#1872
atscott added a commit that referenced this issue Sep 22, 2023
…ion (#1922)

This probably still has its own issues but seems to be at least an improvement over
past scanner issues.

It may be good to spend more time on the correctness of this or just
`ts.createSourceFile`. This previously wasn't done due to perfomance
concerns.

fixes #1872
atscott added a commit that referenced this issue Sep 22, 2023
…ion (#1922)

This probably still has its own issues but seems to be at least an improvement over
past scanner issues.

It may be good to spend more time on the correctness of this or just
`ts.createSourceFile`. This previously wasn't done due to perfomance
concerns.

fixes #1872

(cherry picked from commit bd6282e)
@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 Oct 23, 2023
@angular angular unlocked this conversation Apr 8, 2024
@atscott atscott reopened this Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant