Closed tautologico closed 4 years ago
I'm not sure this can be done in VS Code; there is a way to tell the code that it the new line indentation level should be +-1 relative to current line. Unfortunately, I don't think it's possible to customize it further than that.
EDIT: I opened an issue on SO, but I don't have my hopes high.
I think we can close the issue, as this is duplicate of #9. The formatting/auto-indent feature relies on Racket LSP to work, but as stated in racket-langserver, the formatting feature is still WIP.
I don't think they are the same per se, just related. This issue is more about the behaviour when writing the code, while #9 is more about the formatting when you save the document. Bot are related, but separate problems.
I don't think they are the same per se, just related. This issue is more about the behaviour when writing the code, while #9 is more about the formatting when you save the document. Bot are related, but separate problems.
They are the same, to be specific, it's called onTypeFormatting
in LSP specifications.
As per the LSP specification, there are three types of formatting capabilities:
textDocument/formatting
I think this is whole document formattingtextDocument/rangeFormatting
to format selected range textDocument/onTypeFormatting
Oh wow, I learned something new today! I should really go through the LSP spec once.
Closed as dupe of #9.
By default, DrRacket has automatic indentation, so that when pressing Enter the cursor starts the new line at a point determined by the auto indentation engine, instead of the same first column as the last line. Pressing tab on a line will also reindent the line according to the engine rules. This is related to but not the same as automatic formatting.