Closed proger closed 8 years ago
Out of curiosity, I've tried simplify_smie which doesn't exhibit that problem, but indents code like:
indirect enum Tree {
case Node(Int, Tree)
case Leaf(Int)
}
I have updated my personal branch to support Swift 2.1 https://github.com/taku0/swift-mode/tree/swift-2-indentation. This branch supports indirect keyword and other Swift 2.1 features.
Why aren't @taku0's changes integrated? This mode is almost useless right now because of this issue, and things will get worse when Swift 3 is released.
Anybody here? Or it's dead project?
I made a fork with a new indentation engine for Swift 3. https://github.com/taku0/swift3-mode
Apple also made their own swift-mode.el but seems still in very early stage for now. https://github.com/apple/swift/blob/master/utils/swift-mode.el
Fixed by the new indentation logic.
To reproduce, type the following to the empty buffer:
Note that swift-mode doesn't currently support
indirect
(#96)After pressing
}
you will observe Emacs eat 100% of the cpu (so don't do it when on battery power!). It's hard to make it stop using C-g (tried settingdebug-on-quit
too), sendingUSR2
to the process yields this backtrace:I've captured a profile for
master
code too: https://gist.github.com/proger/56cc097bd9f47a4bafc7 (started with an empty buffer, turned it on, triggered the bug, let it run for some time while reading about USR2 :) )