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

[html] Auto insert Quote when i type equal sign (=) #18071

Closed
ebattulga opened this issue Jan 4, 2017 · 45 comments · Fixed by #137080
Closed

[html] Auto insert Quote when i type equal sign (=) #18071

ebattulga opened this issue Jan 4, 2017 · 45 comments · Fixed by #137080
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities html HTML support issues insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@ebattulga
Copy link

  • VSCode Version: 1.8.1
  • OS Version: Win10

I need option like Visual studio. (Insert attribute value quote automatically)

When i type = (Equal sign) automatically add double quote like this.
1: <div class
2: <div class="|"

Please add this option in Next version! 🙏

@ebattulga ebattulga changed the title Auto insert Quote when i type equal sign (=) Auto insert Quote when i type equal sign (=) in HTML Jan 4, 2017
@aeschli aeschli added feature-request Request for new features or functionality html HTML support issues labels Jan 30, 2017
@aeschli aeschli added this to the Backlog milestone Jan 30, 2017
@aeschli aeschli changed the title Auto insert Quote when i type equal sign (=) in HTML [html] Auto insert Quote when i type equal sign (=) Jan 30, 2017
@fvsch
Copy link

fvsch commented Jun 23, 2017

Currently, when writing attr=" or attr=' you get the matching quote (single or double) automatically. It requires typing one more character, but lets you choose if you want single quotes, double quotes, or none; all three options are valid in HTML, so it might not be a great idea to force double quotes in HTML files.

@skorunka
Copy link

@fvsch that doe snot work for me. When I type <i class=" the closing " is not inserted.

@fvsch
Copy link

fvsch commented Sep 28, 2017

Apparently it works in XML documents but not in HTML documents. :/

@aeschli
Copy link
Contributor

aeschli commented Sep 29, 2017

@skorunka That works for me in HTML as well: Note that this has to be at the end of the line.
If this still doesn't work, disable all extensions. Extensions can overwrite the auto-pair characters.

@Ionaru
Copy link

Ionaru commented Feb 2, 2018

Currently when typing attr<tab>, VSCode auto-inserts the double quotes, it would be nice is the same is applied to attr=.

@skorunka
Copy link

skorunka commented Feb 2, 2018

@aeschli Why it has to be at the end of line? Not all the time you are writing a new HTML code, but also editing the extincting - adding new attributes.

@Ionaru
Copy link

Ionaru commented Feb 2, 2018

@aeschli It is not very common to be typing a HTML attribute at the end of the line.

Imagine typing this: <div>, VSCode will automatically append </div> to it. Now when I want to add an attribute to that div, it is not the end of the line anymore and the auto-pair does not work.

@aeschli
Copy link
Contributor

aeschli commented Feb 5, 2018

The idea behind it is to only automatically add pairs when writing new code, not when modifying code.
I think right now we only do autopairs when the character after the cursor is a new line or a whitespace. We should extend this and allow to specify other characters as well. In the case of HTML, for ' and ", that would be '>'.
I created #42956

@Ionaru
Copy link

Ionaru commented Feb 5, 2018

@aeschli What I mean is that even when typing new code, VSCode automatically creates the closing HTML tag, making the auto-pair impossible.

@aeschli
Copy link
Contributor

aeschli commented Feb 5, 2018

@Ionaru Yes, I get what you mean. Features like auto pair or auto close tags work against the 'writing new code' heuristic that we chose.

@Bjeaurn
Copy link

Bjeaurn commented May 16, 2018

Did the discussion evolve from getting the auto-pairing quotes to work, from the original add auto-paired quotes when typing '=' (HTML)?

What's the word on that feature as I can't find any extensions to achieve the same thing and have very much gotten used to it from other IDEs.

@bmdatl
Copy link

bmdatl commented Jun 7, 2018

Is there any update on this? This is one of the biggest features I miss after switching from WebStorm.

@AchmadFathoni
Copy link

I wondering if there any plug-in that can cover this function.

@tommcclean
Copy link

Would like this feature too, end up just using Visual Studio over vscode if I know I am doing work on markup

@tommulkins
Copy link

Might as well add my $.02 here. I'm surprised how much I miss this feature moving over from PhpStorm.

@Maweypeyyu
Copy link

I really miss the behaviour of typing sty + ENTER/TABand it auto expands to style='|' ( | = cursor :) ). At least in jsx files it doesn't work for me. Does anyone know of a plugin/custom hack that would enable this?

@shaunmoss
Copy link

+1 , All these small things you never knew you would miss when move over from Netbeans, phpstorm etc.

@scottieslg
Copy link

This is seriously not a feature yet??? How does something as simple as this get missed??

@klocus
Copy link

klocus commented Jul 24, 2019

+1.

@Linux249
Copy link

Linux249 commented Nov 5, 2019

+1 Just switch from WebStorm to VsCode and miss this every attribute I wrote

Or is there a plugin for this?

@rushenn
Copy link

rushenn commented Dec 3, 2019

Those who looking for this feature, try this extension https://marketplace.visualstudio.com/items?itemName=AESSoft.aessoft-class-autocomplete

@mesakomarevich
Copy link

It's quite astonishing to me that this functionality hasn't yet been added to VS Code given that so many other popular IDEs and editors do this already, including Visual Studio.

@asmeeee
Copy link

asmeeee commented Jul 23, 2020

Hey there. Any updates on this one?

@ryancco
Copy link

ryancco commented Jul 29, 2020

Would really like to see this as well! Assuming I haven't missed it and it is in fact still on the table/incomplete.

@octoxan
Copy link

octoxan commented Jul 29, 2020

Really only still using PHP Storm because of this. Just even over the course of one project this could save tens of thousands of keypresses, especially since " required 2 keys to be pressed lol

@vegerot
Copy link

vegerot commented Aug 25, 2020

This is one of the features I miss the most from WebStorm. I know it's only a single character (and two keypresses), but it makes thing so much nicer

@sawarkarrajat
Copy link

i have been searching the whole web to resolve this

@ida-frontend
Copy link

Any updates? So frustrated by this...

@AchmadFathoni
Copy link

How to increase the chance of vscode developer will notice this lack of feature?

@trin4ik
Copy link

trin4ik commented Oct 28, 2020

realy stupid situation, i need this shit

@tommulkins
Copy link

This may help. Turn on Auto Closing Quotes and it reaches close to what you want.

image

@trin4ik
Copy link

trin4ik commented Oct 28, 2020

This may help. Turn on Auto Closing Quotes and it reaches close to what you want.

image

no.
in phpStorm i write value= and get value="|", in vsCode i write value= and get value=

@octoxan
Copy link

octoxan commented Oct 28, 2020

So silly that something so universally useful isn't in there yet.

@hmaesta
Copy link

hmaesta commented Feb 13, 2021

adp4rm2tg4u11

@hamedhomaee
Copy link

Hello everyone,
There is still no fix for it?

@kmoth
Copy link

kmoth commented Apr 23, 2021

Depending on the attribute, it'll help you complete the entire attribute name including the ="" bit.
I only came looking for the option to specify single or double for that autocompletion but I'd enjoy a feature that auto-added the quotes after typing =

@Adesin-fr
Copy link

Still missing this feature....

@aeschli aeschli added the help wanted Issues identified as good community contribution opportunities label Oct 15, 2021
@mzsintelec
Copy link

4 years and counting, how is this even possible?

@sawarkarrajat
Copy link

kudos guys i think they have included it in the latest update of the vs code, if you search quotes in setting and search for html quotes you can see it there
image

@jzyrobert
Copy link
Contributor

Hello, I've given this PR a go as you can see from the link above.

Please have a look and comment any suggestions.

@trin4ik
Copy link

trin4ik commented Nov 16, 2021

Hello, I've given this PR a go as you can see from the link above.

Please have a look and comment any suggestions.

great work! as @aeschli says, its need on all language, not only html. very important in jsx. but in jsx need insert not qoutes:

<View style|
<View style={|}

@aeschli aeschli mentioned this issue Jan 24, 2022
2 tasks
@rzhao271 rzhao271 modified the milestones: Backlog, January 2022 Jan 28, 2022
@rzhao271 rzhao271 added the verification-needed Verification of issue is requested label Jan 28, 2022
@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jan 28, 2022

typed <div class=
image

works well!

@TylerLeonhardt TylerLeonhardt added the verified Verification succeeded label Jan 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities html HTML support issues insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.