Eugleo / magic-racket

The best coding experience for Racket in VS Code
https://marketplace.visualstudio.com/items?itemName=evzen-wybitul.magic-racket
GNU General Public License v3.0
204 stars 26 forks source link

Automatic indentation and reindent #6

Closed tautologico closed 4 years ago

tautologico commented 5 years ago

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.

Eugleo commented 5 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.

JJPro commented 4 years ago

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.

Eugleo commented 4 years ago

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.

JJPro commented 4 years ago

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:

Eugleo commented 4 years ago

Oh wow, I learned something new today! I should really go through the LSP spec once.

Eugleo commented 4 years ago

Closed as dupe of #9.