question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to disable auto-completion of double quotes when adding attributes

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: 0.35.0
  • VS Code version: 1.63.2

Problem

I would like to suppress Vetur from auto adding a pair of double quotes when I enter class=.

(This appears to happen when adding any attribute, not just class but I experience this issue with class the most.)

When in HTML mode, when I type: class= I then need to type an additional double quote character which results in: class=“” and my cursor is inside the quotes and I can happily start entering my classes: class=“classname”

With Vetur installed, when I type: class= Vetur auto adds the pair of double quotes: class=“”, with muscle memory, I end up typing the additional double quote, which then takes the place of the second double quote that Vetur inserted and when I start adding classes, I end up doing this: class=“”classname.

I just want consistency. I don’t want to have to think: “When using Vetur I have to not type quotes at all” and “Now I’m using vanilla HTML, I have to add the quotes semi-manually.” If there was a setting in VS Code where I could force VS Code to ALWAYS have the same behavior as Vetur when adding attributes, for all html-type syntaxes, then I would force myself to re-learn the new workflow across he board. But since this does not seem to be possible, it is frustrating to have an extra thing to think about while coding since the behavior is not customizable.

So, I want to know how I can tell Vetur to not automatically add a pair of double quotes when typing class=

vetur-attribuites-quotes 2022-01-07 17_11_26

Reproducible Case

  • Open new file, choose HTML language.

  • Create <div></div>

  • Start adding a class to the div by typing: class=“

  • Note that after you type the opening double quote, the ending double quote is auto added, and you are able to start adding classes inside the quotes as expected.

  • Open a new file, choose Vue as the language, scaffold a new Vue document.

  • Create <div></div>

  • Start adding a class to the div by typing: class=“

  • Note that Vetur adds a pair of double quotes quickly after entering = so when the user enters the editor thinks it is re-typing the closing double quote.

  • The cursor is now outside the double-quote pair, and more work is needed to properly add the class in the right place.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

1reaction
evad1ncommented, Jan 11, 2022

@rareyman I have no idea how to make mine do that. My workaround now is to just the tab-completion for html attributes which auto inserts the equal sign and quotes.

0reactions
serialinecommented, Apr 20, 2022

like this i also need this feature on *.vue too https://github.com/microsoft/vscode/issues/18071

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable autocompletion for quotation marks when ...
Here you can disable them from being added after attributes equal sign. You can also disable them so they don't automatically close. Share....
Read more >
How to disable automatic double quote insertion after typing ...
When I type something like <div id=, it will automatically add quote marks and put my cursor inside them: <div id="I". But when...
Read more >
188189 – Option to disable smart quotes (doubling of " and ')
If you mean that the autocompletion works bad in html editor on element attributes with javascript content, please add here some usecases.
Read more >
VS2022 Preview 4.1:"Insert attribute value quotes" settings not ...
As per title, setting the option Text Editor > HTML > “Insert attribute value” quotes to true seems to be not working on...
Read more >
Disable auto-closing for quotes/pa… | Apple Developer Forums
I just started using Xcode (12.3) and tried disabling all auto-closing and autocompletion in the preferences but still get auto-closing parentheses, quotes, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found