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

Template literals with substitutions are auto-completed with too many backticks #132912

Closed
thebinarysearchtree opened this issue Sep 11, 2021 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoclosing Editor automatic closing of parens / brackets / etc. insiders-released Patch has been released in VS Code Insiders javascript JavaScript support issues typescript Typescript support issues verified Verification succeeded
Milestone

Comments

@thebinarysearchtree
Copy link
Contributor

thebinarysearchtree commented Sep 11, 2021

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.60
  • OS Version: MacOS Big Sur

This only started occurring recently.

test.mov
@mjbvz mjbvz added editor-autoclosing Editor automatic closing of parens / brackets / etc. help wanted Issues identified as good community contribution opportunities javascript JavaScript support issues typescript Typescript support issues labels Sep 14, 2021
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Oct 11, 2021
@hediet
Copy link
Member

hediet commented Oct 13, 2021

This is difficult to solve nicely.

Maybe the backtick should be autoclosed if the opening backtick was tokenized as string (overriding any word rule)? @alexdima

@thebinarysearchtree
Copy link
Contributor Author

thebinarysearchtree commented Oct 14, 2021

This bug also occurs in Python, Ruby, and Swift. It does not occur in PHP, c#, and a couple of other languages. Strangely, those languages report the token type as a string, which makes no sense to me.

@alexdima
Copy link
Member

This has been fixed by PR #135197

@alexdima alexdima removed the help wanted Issues identified as good community contribution opportunities label Oct 27, 2021
@alexdima alexdima reopened this Oct 28, 2021
@alexdima
Copy link
Member

alexdima commented Oct 28, 2021

The PR #135197 improves things, and makes it unlikely that this case is hit, but this case remains:

Pressing ` will insert two backticks here:

const t2 = `something ${t1}|

@alexdima alexdima added this to the November 2021 milestone Nov 20, 2021
@alexr00
Copy link
Member

alexr00 commented Dec 2, 2021

Verified that in the example the first backtick is autocompleted, so I don't need to add a backtick at the problematic location.

@alexr00 alexr00 added the verified Verification succeeded label Dec 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoclosing Editor automatic closing of parens / brackets / etc. insiders-released Patch has been released in VS Code Insiders javascript JavaScript support issues typescript Typescript support issues verified Verification succeeded
Projects
None yet
6 participants
@thebinarysearchtree @hediet @alexdima @mjbvz @alexr00 and others