Open asm0dey opened 4 months ago
Whew, that's a pretty ugly result from formatting. Thanks for the report.
the problem here is semicollon.
If you remove all the semicollons it should format correctly
Thanks for the answer! According to the docs, semicolon is an allowed delimiter. If it's not supported, I would expect it to be highlighted by the IDE. Also, IIRC, I got this ill-formatted pkl from the json module during import.
Just checked, when I use the following command:
pkl eval -p input="$(cat my.json)" -x 'new Parser {}.parse(read("prop:input"))' pkl:json
I've got an output that cannot be formatted by IDEA
Semicolons are treated as whitespace in Pkl. FYI; our style guide is to use them to separate inline object members--if object members are on their own line, semicolons should be omitted.
Got you, thanks! I think they should be underlined as incorrect then
Don’t get me wrong: I am just pointing out the problem that case formattter to act up is semicolon, it can be worked around by just removing every thing, but it’s better to be fixed .
Let's say I have a poorly-formatted, but working file:
When I run the command
It successfully compiles an expected json. However, when I execute a "Reformat" action (and I do it all the time), I get the following:
This file cannot be compiled to JSON anymore.
I would expect the "Reformat" to not break my code and, if possible, align it.
My environment: