Snippet should respect formatting settings
Snippet should respect formatting settings
snippets should simply be processed by the formatter before being sent back to the client
snippets should simply be processed by the formatter before being sent back to the client
Indeed it's the simple mean to fix thi sissue, but it means each time you type something, you will format all available snippets?
yes, but since they're small, it should be fast
they can even be cached, until preferences changes
If we wish to apply formatter to the snippet, it requires to improve dramasticly the formatter to format invalid content. For instance if you try to format:
<!DOCTYPE ${1:root-element} PUBLIC \"${2:public-id}\" \"${3:file}.dtd\">
<${1:root-element}>${0}
</${1:root-element}>
the formatter result is very bad:
<!DOCTYPE ${1:root-element} PUBLIC \"${2:public-id}\" \"${3:file}.dtd\">
<null>${0}
The hard thing is that <${1:root-element}> is not a valid tag name (because it contains $), so the parser (today) cannot consider it's a valid tag name. This issue is very hard and requires some investigation about formatting invalid content and in same time $ must be considered as a valid tag name (for the snippet usecase).