-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Formatting while typing #593
Copy link
Copy link
Closed
Labels
locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Metadata
Metadata
Assignees
Labels
locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
This is gonna be a fun issue...
So a lot of editors try to do code formatting while you are typing, and to varying degrees they all kinda suck at it.
While it's an okay experience to format on save or after the fact, it would be nice if things were auto-formatting while typing.
There's a couple messages in the language-server-protocol for "formatting requests":
Each of this represents a different opportunity for prettier to fix the formatting of code.
One of the important pieces here will be that it will be possible to have an invalid program which Babylon will currently reject because the user hasn't finished making it valid. Will have to talk to Babylon folks about implementing a "loose" parser which can recover from mistakes (cc @hzoo @danez).
While the language-server-protocol doesn't work everywhere. If more tools like prettier embraced it, it would push more editors to formally implement it, which would be a nice effect.