-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Add doNotAddAttributeQuotes setting to disable automatic quotes #129284
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 in zignd/HTML-CSS-Class-Completion#235 and gencer/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 |
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 and microsoft/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 in microsoft/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 ! |
This depends on microsoft/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="|"
.