New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch smie fixes #76
Batch smie fixes #76
Conversation
It's important in conjuctiontions with case statement. It's a common rule to connect ":" with a variable. In this case ":" will appear as a part of the identifier, we need this token separately to acivate grammar.
is a last or first symbol on the line. Important for ternary operator.
function header grammar
overlap with generics token
function declarations
implicit semicolon after operators
for the last token on the line
swift code) and improve support for several form of multi-line expressions
Don't have emacs 23 atm. Will check failing tests in VM tomorrow, will take some time. |
It still a bit hard to express actual grammar for this statements
Hey @bbatsov or @taku0, can I ask you to review this PR. Sorry it has so many commits and it took so long, but it fixes quite a few issues raised by @taku0 and many others. It also provides alternative solution to what @taku0 did in #74. I didn't change cases that are qualified as personal preferences. I would prefer to address those cases in separate PR with possibility of adding customizable parameters. I hope I didn't miss any issues here, but if that happened feel free to create a new issue or re-open a previous one. I tried to preserve support for the emacs 24.3, unfortunately it wasn't possible for 3 test cases. For some reason emacs 24.3 treats parent based indentation rules differently (I actually think it's a bug), so I had to make assertions conditional. This sounds a bit gross, so I'm keen to hear other opinions about what should we do in this case. |
I'll have a look at the code.
As many modes started to adopt smie in 24.4 a lot of bugs were fixed then. I'm fine with dropping 24.3 support altogether. As I said before - the upgrade path is trivial on all operating systems. |
It seems that there are almost no problems for practical use. Some cases we should handle better: let foo =
bar +
baz +
a
enum Foo: Bar {
case foo
case bar
var foo
}
let foo = [
bar:
baz, // I want an extra indentation for this line
bar:
baz, // and this line
]
enum Foo {
case A(Int, [Int : String]), B, C
func foo() {
}
}
@Foo public class Foo {
a
} |
b226310
to
b6bad10
Compare
@bbatsov this should be ready to merge. |
Yeah, everything looks good! Great work, @ap4y! You'll soon give XCode a run for its money! :-) |
Haha thanks :) XCode indentation engine is a complete disaster imo. I'm going to close some issues, github doesn't support list of references, so will do it manually. |
Batch of improvements for the issues raised in #74. Also fixes #60, #73, #58, #77, #80, #81.