Add doNotAddAttributeQuotes setting to disable automatic quotes

This commit is contained in:
Stephen Sigwart 2021-07-23 22:27:09 -04:00
parent 917f070c2e
commit 40b976f056
3 changed files with 11 additions and 0 deletions

View file

@ -188,6 +188,12 @@
"default": true,
"description": "%html.autoClosingTags%"
},
"html.doNotAddAttributeQuotes": {
"type": "boolean",
"scope": "resource",
"default": false,
"description": "%html.doNotAddAttributeQuotes%"
},
"html.hover.documentation": {
"type": "boolean",
"scope": "resource",

View file

@ -28,6 +28,7 @@
"html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.",
"html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.",
"html.autoClosingTags": "Enable/disable autoclosing of HTML tags.",
"html.doNotAddAttributeQuotes": "Controls whether quotes are automatically added when completing an attribute.",
"html.mirrorCursorOnMatchingTag": "Enable/disable mirroring cursor on matching HTML tag.",
"html.mirrorCursorOnMatchingTagDeprecationMessage": "Deprecated in favor of `editor.linkedEditing`",
"html.hover.documentation": "Show tag and attribute documentation in hover.",

View file

@ -26,6 +26,10 @@ export function getHTMLMode(htmlLanguageService: HTMLLanguageService, workspace:
if (doAutoComplete) {
options.hideAutoCompleteProposals = true;
}
let doNotAddAttributeQuotes = settings && settings.html && settings.html.doNotAddAttributeQuotes;
if (doNotAddAttributeQuotes) {
options.doNotAddAttributeQuotes = true;
}
const htmlDocument = htmlDocuments.get(document);
let completionList = htmlLanguageService.doComplete2(document, position, htmlDocument, documentContext, options);