Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
aeschli merged 3 commits intomicrosoft:mainfromssigwart:noQuotes
Oct 15, 2021

Conversation

ssigwart
Copy link
Contributor

@ssigwartssigwart commentedJul 24, 2021
edited
Loading

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 inmicrosoft/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 theclass completion:

<divclas|

With this setting enabled, it should beclass=|, notclass="|".

escape0707 reacted with heart emoji
@@ -188,6 +188,12 @@
"default": true,
"description": "%html.autoClosingTags%"
},
"html.doNotAddAttributeQuotes": {
Copy link
Contributor

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

@aeschli
Copy link
Contributor

I'd rather avoid new settings as they make the product more complex and add are costly to maintain.
So before adding a setting I'd like to see more user request for it.

@ssigwart
Copy link
ContributorAuthor

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 letclass="|" auto-complete, then hit backspace, then type the quote and CSS completion will work. If the quotes weren't auto-inserted, it would be more intuitive.

Alternatively, would it be acceptable to write a patch where if you haveeditor.autoClosingOvertype set tonever and type" inclass="|" just after it's inserted, it will assume you meant to type the opening brace an overwrite it similar to theeditor.autoClosingOvertype setting? Currently, it winds up asclass=""|".

@aeschli
Copy link
Contributor

aeschli commentedAug 18, 2021
edited
Loading

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
html.completion.attributeDefaultValue=empty | singleQuotes | doubleQuotes

@ssigwart
Copy link
ContributorAuthor

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.

@ssigwart
Copy link
ContributorAuthor

@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.

@aeschli
Copy link
Contributor

That looks good, thanks@ssigwart ! I'll merge it next week.

@ssigwart
Copy link
ContributorAuthor

Thanks,@aeschli. I'm really looking forward to this setting.

@aeschliaeschli reopened thisOct 15, 2021
@aeschliaeschli merged commit8d70e04 intomicrosoft:mainOct 15, 2021
@aeschli
Copy link
Contributor

Thanks@ssigwart !

@ssigwartssigwart deleted the noQuotes branchOctober 16, 2021 15:42
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 29, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aeschliaeschliaeschli requested changes

Assignees

@aeschliaeschli

Labels
None yet
Projects
None yet
Milestone
October 2021
Development

Successfully merging this pull request may close these issues.

2 participants
@ssigwart@aeschli

[8]ページ先頭

©2009-2025 Movatter.jp