Merge pull request #129284 from ssigwart/noQuotes

Add doNotAddAttributeQuotes setting to disable automatic quotes
This commit is contained in:
Martin Aeschlimann 2021-10-15 19:56:02 +02:00 committed by GitHub
commit 8d70e049dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View file

@ -38,6 +38,22 @@
"type": "object",
"title": "HTML",
"properties": {
"html.completion.attributeDefaultValue": {
"type": "string",
"scope": "resource",
"enum": [
"doublequotes",
"singlequotes",
"empty"
],
"enumDescriptions": [
"%html.completion.attributeDefaultValue.doublequotes%",
"%html.completion.attributeDefaultValue.singlequotes%",
"%html.completion.attributeDefaultValue.empty%"
],
"default": "doublequotes",
"description": "%html.completion.attributeDefaultValue%"
},
"html.customData": {
"type": "array",
"markdownDescription": "%html.customData.desc%",

View file

@ -28,6 +28,10 @@
"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.completion.attributeDefaultValue": "Controls the default value for attributes when completion is accepted.",
"html.completion.attributeDefaultValue.doublequotes": "Attribute value is set to \"\".",
"html.completion.attributeDefaultValue.singlequotes": "Attribute value is set to ''.",
"html.completion.attributeDefaultValue.empty": "Attribute value is not set.",
"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,7 @@ export function getHTMLMode(htmlLanguageService: HTMLLanguageService, workspace:
if (doAutoComplete) {
options.hideAutoCompleteProposals = true;
}
options.attributeDefaultValue = settings.html.completion.attributeDefaultValue ?? 'doublequotes';
const htmlDocument = htmlDocuments.get(document);
let completionList = htmlLanguageService.doComplete2(document, position, htmlDocument, documentContext, options);