Open frou opened 2 months ago
I'd say that ideally it should work. The rules get a bit odd because when starting e.g. a new function, there's not an concrete syntax tree (CST) node there that we can attach indentation rules to. I thought we had worked around this with a rule like "anything after the braces is indented" but I'll need to check again.
Thank you, that explanation makes a lot of sense.
@J3RN should indentation work when creating a newline inside of a pub type Blah {} brace? Seems to not work in those, only in functions
Obviously I'm a bit strapped for time lately, but if someone wants to investigate these issues, you can play with the indentations rules. Happily they're quite declarative, though the selectors (e.g. parent-bol
) are a bit arbitrarily defined.
e.g. when typing a function signature and pressing RET after the opening
{
, should the new line be automatically indented by an additional 2 spaces?I see that the
gleam-ts-mode.el
file has a good amount of stuff related to indentation, but I'm not sure if such auto-indentation on RET is supposed to work yet. It doesn't for me.