Debugging implementation for Swift Local Refactoring action.
If you have built
swift-refactor tool using
ninja, then you’d have to use command line
lldb debugger to debug the code.
So after building
swift-refactor, just run
lldb in the terminal:
Next, tell the debugger which executable to debug (
swift-refactor in this case):
Then set the breakpoint, e.g. for
isApplicable implementation of
lldb to run the executable with
The debugger has now stopped on line
1714 and is ready for your further input:
Same debug commands you’d use in Xcode UI work in command line:
If you choose to develop using Xcode, debugging is even easier.
Edit the swift-refactor scheme
and add launch arguments:
Set breakpoint and hit “Run”: