Tips for code formatting on VSCode? #654
-
I just started playing around with teal this week and I'm loving it. I'm planning to use it to make games in LOVE 2D. I want to set up code formatting in VSCode so that tabs and whitespace rules can be automatically fixed on save. Has anyone had any success doing this? Or could point me to some resources to get started? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello! The VSCode extension does not currently support this. It does support a basic form of auto-indenting (through 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. |
Beta Was this translation helpful? Give feedback.
Hello!
The VSCode extension does not currently support this. It does support a basic form of auto-indenting (through
increaseIndentPattern
anddecreaseIndentPattern
inlanguage-configuration.json
) but it is very unreliable. You can try it out manually withCtrl+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.