Skip to content

Commit 8d70e04

Browse files
authored
Merge pull request microsoft#129284 from ssigwart/noQuotes
Add doNotAddAttributeQuotes setting to disable automatic quotes
2 parents b1c3c96 + ba48f5c commit 8d70e04

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

extensions/html-language-features/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@
3838
"type": "object",
3939
"title": "HTML",
4040
"properties": {
41+
"html.completion.attributeDefaultValue": {
42+
"type": "string",
43+
"scope": "resource",
44+
"enum": [
45+
"doublequotes",
46+
"singlequotes",
47+
"empty"
48+
],
49+
"enumDescriptions": [
50+
"%html.completion.attributeDefaultValue.doublequotes%",
51+
"%html.completion.attributeDefaultValue.singlequotes%",
52+
"%html.completion.attributeDefaultValue.empty%"
53+
],
54+
"default": "doublequotes",
55+
"description": "%html.completion.attributeDefaultValue%"
56+
},
4157
"html.customData": {
4258
"type": "array",
4359
"markdownDescription": "%html.customData.desc%",

extensions/html-language-features/package.nls.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
"html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.",
2929
"html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.",
3030
"html.autoClosingTags": "Enable/disable autoclosing of HTML tags.",
31+
"html.completion.attributeDefaultValue": "Controls the default value for attributes when completion is accepted.",
32+
"html.completion.attributeDefaultValue.doublequotes": "Attribute value is set to \"\".",
33+
"html.completion.attributeDefaultValue.singlequotes": "Attribute value is set to ''.",
34+
"html.completion.attributeDefaultValue.empty": "Attribute value is not set.",
3135
"html.mirrorCursorOnMatchingTag": "Enable/disable mirroring cursor on matching HTML tag.",
3236
"html.mirrorCursorOnMatchingTagDeprecationMessage": "Deprecated in favor of `editor.linkedEditing`",
3337
"html.hover.documentation": "Show tag and attribute documentation in hover.",

extensions/html-language-features/server/src/modes/htmlMode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function getHTMLMode(htmlLanguageService: HTMLLanguageService, workspace:
2626
if (doAutoComplete) {
2727
options.hideAutoCompleteProposals = true;
2828
}
29+
options.attributeDefaultValue = settings.html.completion.attributeDefaultValue ?? 'doublequotes';
2930

3031
const htmlDocument = htmlDocuments.get(document);
3132
let completionList = htmlLanguageService.doComplete2(document, position, htmlDocument, documentContext, options);

0 commit comments

Comments
 (0)