takikawa / sweet-racket

A port of sweet expressions to Racket
http://pkg-build.racket-lang.org/doc/sweet/index.html
Other
47 stars 10 forks source link

DrRacket indentation #32

Open jackfirth opened 9 years ago

jackfirth commented 9 years ago

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

takikawa commented 9 years ago

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

AlexKnauth commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

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