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

DrRacket indentation

Open jackfirth opened this issue 10 years ago • 4 comments

Sweet expressions mess with DrRacket's default indentation. Is there a way to tell DrRacket how to indent sweet expressions?

jackfirth avatar Aug 21 '15 18:08 jackfirth

It's possible, but it would involve writing a custom indenter.

Basically the sweet-exp language would have to export a value for this get-info key:

http://plt.eecs.northwestern.edu/snapshots/current/doc/tools/adding-languages.html?q=indentation#%28idx._%28gentag.17.%28lib._scribblings%2Ftools%2Ftools..scrbl%29%29%29

takikawa avatar Aug 21 '15 18:08 takikawa

I managed to make an indenter that does nothing, so that it never un-indents a properly indented form: https://github.com/takikawa/sweet-racket/pull/33

AlexKnauth avatar Aug 25 '15 01:08 AlexKnauth

@jackfirth @takikawa I modified the indenter in #33 to use normal s-expression indenting rules within an s-expression, and otherwise not change anything.

AlexKnauth avatar Aug 25 '15 19:08 AlexKnauth

@jackfirth When you update, is the indentation better now?

AlexKnauth avatar Aug 25 '15 20:08 AlexKnauth