Skip to content

Commit

Permalink
feat(vscode): support for vue.format.wrapAttributes setting
Browse files Browse the repository at this point in the history
close #4212
  • Loading branch information
johnsoncodehk committed Apr 7, 2024
1 parent e9fa3a2 commit 639c2eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,19 @@
"vue.format.script.initialIndent": {
"type": "boolean",
"default": false
},
"vue.format.wrapAttributes": {
"type": "string",
"default": "auto",
"enum": [
"auto",
"force",
"force-aligned",
"force-expand-multiline",
"aligned-multiple",
"preserve",
"preserve-aligned"
]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/lib/plugins/vue-sfc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function create(): LanguageServicePlugin {
return {
...options,
...formatSettings,
wrapAttributes: 'auto',
wrapAttributes: await context.env.getConfiguration?.<string>('vue.format.wrapAttributes') ?? 'auto',
unformatted: '',
contentUnformatted: blockTypes.join(','),
endWithNewline: options.insertFinalNewline ? true
Expand Down

0 comments on commit 639c2eb

Please sign in to comment.