You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we could get correct indentation at and around statements continued across linebreaks, I could probably code for a while without needing to use dartfmt as often.
Here's an example, taken from the dart style guide, formatted incorrectly by dart-mode.
In other words, if you've formatted correctly at line three, then dart-mode indents incorrectly at line five, and the user is looking forward to typing out a parsable file again so that line five will be fixed.
I think this is more important than getting the amount of indentation perfect, for example, matching dartfmt exactly, or knowing when to indent by two or four spaces. The indentation above not only differs from dartfmt, but is a bit harder to read.
To illustrate what I mean by the difference between two and four not being as important, I think the following would be satisfactory if dart-mode could get it correctly:
I think readable code is a reasonable target for dart-mode indentation function, and not as important as matching dartfmt perfectly. The user can wait for dartfmt to be applied at a convenient time. After all, dart-mode's indentation can come in handy when the file is not parsable.
The best approach would seem to be to read and understand the indentation function from go-mode.el, as it looks to be very concise and solve a similar problem.
The text was updated successfully, but these errors were encountered:
Hmm, if the previous lines were indented by dartfmt, that could motivate wanting dart-mode to be aware of when to use two versus four. At least for continued lines perhaps. But again, it might be an improvement for many cases if at least there were a two space dedent after that semi colon on line three.
This seems like the biggest bug currently.
If we could get correct indentation at and around statements continued across linebreaks, I could probably code for a while without needing to use
dartfmt
as often.Here's an example, taken from the dart style guide, formatted incorrectly by dart-mode.
In other words, if you've formatted correctly at line three, then dart-mode indents incorrectly at line five, and the user is looking forward to typing out a parsable file again so that line five will be fixed.
I think this is more important than getting the amount of indentation perfect, for example, matching dartfmt exactly, or knowing when to indent by two or four spaces. The indentation above not only differs from dartfmt, but is a bit harder to read.
To illustrate what I mean by the difference between two and four not being as important, I think the following would be satisfactory if dart-mode could get it correctly:
I think readable code is a reasonable target for dart-mode indentation function, and not as important as matching dartfmt perfectly. The user can wait for dartfmt to be applied at a convenient time. After all, dart-mode's indentation can come in handy when the file is not parsable.
The best approach would seem to be to read and understand the indentation function from go-mode.el, as it looks to be very concise and solve a similar problem.
The text was updated successfully, but these errors were encountered: