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

Typing attr= followed by "value results in value being inserted after the automatically added closing quote #917

Closed
AnthonyWeston opened this issue Jan 30, 2022 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@AnthonyWeston
Copy link

I can't think of another language extension that automatically inserts opening and closing quotes automatically, but typically the closing quote is inserted automatically after the user enters the opening quote. I don't mind that Volar adds both quotes automatically after an attribute (I think it makes sense, actually), but since I always type the opening quote by habit and the cursor is moved between the inserted quotes, I frequently end up typing the attribute value after the closing quote.

Steps to reproduce:

  1. Insert a tag in the <template> section of a single-file component
  2. Add an attribute to the tag by placing the cursor after the tag name and typing attr=. A pair of double quotes is automatically inserted after the =.
  3. Enter a double quote, followed by the value
    Expected result: The attribute value is inserted between the double quotes: <tag attr="value" />
    Actual result: The tag attribute value is inserted after the closing quote: <tag attr""value />
@hissalht
Copy link

Please add a setting to disable this feature. It is very buggy and barely useful.

In a live share session, if another user is working on the same file and I type class=, their cursor is teleported to my position and we "both" insert double quotes resulting in something like class="""".

This makes collaborating on vue files extremely annoying.

It also messes with my muscle memory, I dont need to autocomplete a single keystroke. Even more so if this completion only happen for HTML in .vue files and not in normal .html files.

@yaegassy
Copy link
Collaborator

@hissalht To disable this feature, try adding "html.autoCreateQuotes": false in .vscode/settings.json. It's grayed out, but it works fine.

auto-create-quotes-false

@hissalht
Copy link

@yaegassy Thanks for the quick response ! It works !

@johnsoncodehk
Copy link
Member

Duplicate of #840

@johnsoncodehk johnsoncodehk marked this as a duplicate of #840 Feb 12, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants