racket-langserver icon indicating copy to clipboard operation
racket-langserver copied to clipboard

Remove whitespace at end of line on format

Open ryanslade opened this issue 4 years ago • 3 comments

Is it possible to remove trailing whitespace at the end of a line when formatting?

I'm happy to have a go at this if you can point me in the right direction :)

ryanslade avatar Apr 07 '21 07:04 ryanslade

The code that does that is here --- https://github.com/jeapostrophe/racket-langserver/blob/master/text-document.rkt#L417-L447

However, we basically just lean on Racket's text% object, which is a monster with tons of options --- https://docs.racket-lang.org/gui/text_.html --- plus there are many sub-classes and mixins that we could enable. I honestly don't know where we would start on something like that.

jeapostrophe avatar Apr 07 '21 14:04 jeapostrophe

Not sure if it is helpful for this, but there is a tool (not on the package server) for DrRacket to remove whitespace when saving files.

https://github.com/97jaz/drwhitespace

samdphillips avatar Apr 08 '21 01:04 samdphillips

Is it possible to remove trailing whitespace at the end of a line when formatting?

I'm happy to have a go at this if you can point me in the right direction :)

I think this is completed at 6b6a3c27e33eca6df88cc3230d26b82b3db72e9f

dannypsnl avatar Aug 19 '21 15:08 dannypsnl