Skip to content

Tips for code formatting on VSCode? #654

Answered by pdesaulniers
javi7 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

The VSCode extension does not currently support this. It does support a basic form of auto-indenting (through increaseIndentPattern and decreaseIndentPattern in language-configuration.json) but it is very unreliable. You can try it out manually with Ctrl+Shift+P > Reindent Lines.

I think the best way to tackle this would be to implement some sort of formatting tool, as proposed in #84. Then, the next step would be to integrate this tool into the VSCode extension.

I haven't looked into it, but I assume you would need to parse the document using Teal's API, then convert the AST back into code, based on some formatting rules.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by javi7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants