Skip to content

Commit

Permalink
Merge pull request #129284 from ssigwart/noQuotes
Browse files Browse the repository at this point in the history
Add doNotAddAttributeQuotes setting to disable automatic quotes
  • Loading branch information
aeschli committed Oct 15, 2021
2 parents b1c3c96 + ba48f5c commit 8d70e04
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions extensions/html-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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%",
Expand Down
4 changes: 4 additions & 0 deletions extensions/html-language-features/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8d70e04

Please sign in to comment.