- Notifications
You must be signed in to change notification settings - Fork33.8k
Add doNotAddAttributeQuotes setting to disable automatic quotes#129284
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -188,6 +188,12 @@ | |||
"default": true, | |||
"description": "%html.autoClosingTags%" | |||
}, | |||
"html.doNotAddAttributeQuotes": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this should follow the style of the existing settings, e.g. html.completion.attributeQuotes
I'd rather avoid new settings as they make the product more complex and add are costly to maintain. |
Thanks,@aeschli. Where would other users request it? Should I add an issue so it can go into the backlog candidate flow. Also, do you think I'd be able to write an extension to accomplish this? I can't think of a way without writing a whole LSP extension for HTML, which would be overkill. For reference, I personally prefer typing the quote myself. I can probably train myself to stop type the quote, but the bigger issue is that is seems like VSCode doesn't recognize trigger characters if they were part of a completion. That seems to be the issue inzignd/HTML-CSS-Class-Completion#235 andgencer/SCSS-Everywhere#36 for CSS completion. Currently, the way to work around that is to let Alternatively, would it be acceptable to write a patch where if you have |
aeschli commentedAug 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, an issue that goes through backlog candidate would be the way to get other users feedback and votes. I would be more open to it we could make setting a bit more general. Some users might prefer single quotes |
Thanks,@aeschli. I like that idea. I updated this pull request andmicrosoft/vscode-html-languageservice#112 to do that. I also opened#131144 to track if there's interest in this. |
@aeschli, I updated this to match the changes inmicrosoft/vscode-html-languageservice#112. I rebased it and now there's an error with typescript, which I didn't touch, so I ignored it. Please let me know if I should rebased at a later point once that error is resolved. |
That looks good, thanks@ssigwart ! I'll merge it next week. |
Thanks,@aeschli. I'm really looking forward to this setting. |
Thanks@ssigwart ! |
Uh oh!
There was an error while loading.Please reload this page.
This depends onmicrosoft/vscode-html-languageservice#112
This allows users to disable the automatic quotes after an HTML attribute. I'm not sure the best way to test this since it depends on the pull request in
microsoft/vscode-html-languageservice
. I tested by manually modifyingextensions/html-language-features/server/node_modules/vscode-html-languageservice/lib/umd/services/htmlCompletion.js
to apply the changes.A simple test is to use following and trigger the
class
completion:With this setting enabled, it should be
class=|
, notclass="|"
.