-
Notifications
You must be signed in to change notification settings - Fork 123
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
autocomplete fails when input or output is prefixed with $ #2139
Comments
I haven't been able to reproduce this issue myself. Is this still a problem for you and if so, can you provide a minimal project in a github repo? |
Thanks very much for the followup @atscott. Your comment got me thinking that maybe it was another extension causing an issue, so I upgraded vscode to the latest and disabled all extensions other than the angular language server, but it still repro'd for me. I created a minimal repro here. Steps to reproduce:
For me, it clears out the entire string and i'm left with Does autocomplete work normally for you when selecting the |
Okay, thanks. I'm able to reproduce this now. I believe this is going to be a problem with the snippet completions and needing to escape the dollar sign. Should be reasonably simple to fix |
Dollar signs need to be escaped so they are not replaced during snippet expansion: https://code.visualstudio.com/docs/editing/userdefinedsnippets#_how-do-i-have-a-snippet-place-a-variable-in-the-pasted-script fixes angular/vscode-ng-language-service#2139
…#60597) Dollar signs need to be escaped so they are not replaced during snippet expansion: https://code.visualstudio.com/docs/editing/userdefinedsnippets#_how-do-i-have-a-snippet-place-a-variable-in-the-pasted-script fixes angular/vscode-ng-language-service#2139 PR Close #60597
🐞 bug report
Is this a regression?
I am not sure. I haven't seen this issue before, but I also just started using a naming convention which causes it.
Description
In all of my angular components, autocomplete fails when the name of the attribute begins with a dollar sign. I recently started converting my codebase to use signals, and use a $prefix to denote that the entity is a signal. Whenever typing the name of the variable into my template (whether in a separate html file, or inlined in a component
template
string), pressingtab
orenter
to trigger autocomplete removes any partially typed value and leaves me with[]=""
, or()=""
. Removing the $ from the name of the variable makes the issue go away.Bug Type
What does this bug affect
Reproduction
Steps to reproduce the behavior:
$inputValue
input signal.<app-my-component [$inpu]/>
-> press tab to select$inputValue
from intellisense.Expected behavior
I expect the input name to complete and be left with:
<app-my-component [$inputValue]="" />
with the cursor between the quotesLogs
The full log file was 66,000 lines long. But this is the part of the log file that got added when I tried to add a handler with a $ prefix, which got cleared, and an input binding without a dollar sign prefix that got auto-completed successfully - in that order.
Screenshots
Prior to pressing

tab
Immediately after pressing

tab
🌍 Your Environment
Angular Version:
Extension Version:
VSCode Version:
Operating System:
Extension options:
Anything else relevant?
The text was updated successfully, but these errors were encountered: