Visual Studio CodeでSmartyのテンプレートを編集しています。
コード整形時に {…} を含む文が思うように整形されないため、お知恵を拝借できませんでしょうか。
コードの整形にはエクステンションの「Beautify 」を使用し、言語モードは「html」を使用しています。
Beautifyの設定は下記の通りです。
json
1"beautify.config": { 2 "indent_size": 2, 3 "brace_style": "expand", 4 "indent_body_inner_html": false, 5 "indent_head_inner_html": false, 6 "end_with_newline": true, 7 "preserve_newlines": false, 8 "end-with-newline": true, 9 "unformatted": [ 10 "a", "abbr", "area", "audio", "b", "bdi", "bdo", "br", "button", "canvas", "cite", "code", "data", "datalist", "del", "dfn", "em", "embed", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "map", "mark", "math", "meter", "noscript", "object", "output", "progress", "q", "ruby", "s", "samp", "select", "small", "span", "strong", "sub", "sup", "svg", "template", "textarea", "time", "u", "var", "video", "wbr", "text", "acronym", "address", "big", "ins", "strike", "tt" 11 ], 12 "indent_handlebars": true 13 }, 14 15 "beautify.language": { 16 "js": { 17 "type": [ 18 "javascript", 19 "json" 20 ], 21 "filename": [ 22 ".jshintrc", 23 ".jsbeautify" 24 ] 25 }, 26 "css": [ 27 "css", 28 "scss" 29 ], 30 "html": [ 31 "htm", 32 "html", 33 "smarty" 34 ] 35 }
#やりたいこと
tpl
1<div> {include file="common/header.tpl"} {include file="common/footer.tpl"} </div>
上記設定でこう整形されてしまうのを
tpl
1<div> 2{include file="common/header.tpl"} 3{include file="common/footer.tpl"} 4</div>
こうしたい。
#ためしたこと
・Beautifyではなく標準のソース整形機能(WinでShift+Alt+F)
⇒ 同じ結果
・エクステンション「Smarty」を入れてbeautify or 標準整形
⇒ 同じ結果
#入れているエクステンション
- .ejs
- Auto Rename Tag
- Beautify
- CSS Peak
- Git History
- HTML Snippets
- HTMLHint
- IntelliSense for CSS class names
- Smarty
よろしくお願い致します。
あなたの回答
tips
プレビュー