Closed gavinking closed 10 years ago
Not on the command line (although extends
and satisfies
are indented by 2 levels instead of 1). Probably an IDE integration issue.
Oh, I know what’s happening, and it should’ve been obvious. I’m stupid.
The code I hacked together (without ever being able to test it – it’s remarkable it works as well as it does :D ), and that’s now in the IDE, doesn’t pass a TokenStream
to the formatter – which means the formatter can’t know that you have line breaks in your code. I assume the IDE already has a token stream somewhere? (Needs to be a BufferedTokenStream
though – CommonTokenStream
removes WS.)
(At the moment, the IDE is a big, unindented test case for #17. Glad to know it actually works :) )
Okay, I can get a List<CommonToken>
from the CeylonParseController
(and it includes WS tokens)… can I turn that into a TokenSource
somehow?
Well TokenSource
is a very basic interface (I thought it had all that LT
stuff I’d have to worry about), so I can just implement it directly.
ceylon-ide-eclipse PR incoming…
The token stream is available from the CeylonParseController.
Sent from my iPhone
On 26 Jun 2014, at 3:41 pm, Lucas Werkmeister notifications@github.com wrote:
Oh, I know what’s happening, and it should’ve been obvious. I’m stupid.
The code I hacked together (without ever being able to test it – it’s remarkable it works as well as it does :D ), and that’s now in the IDE, doesn’t pass a TokenStream to the formatter – which means the formatter can’t know that you have line breaks in your code. I assume the IDE already has a token stream somewhere? (Needs to be a BufferedTokenStream though – CommonTokenStream removes WS.)
(At the moment, the IDE is a big, unindented test case for #17. Glad to know it actually works :) )
— Reply to this email directly or view it on GitHub.
By default, this:
Gets turned into this: