Atom is a text editor by Github which is marketed as “A hackable text editor for the 21st Century”. It is written in CoffeeScript which is pretty looking Javascript. Writing packages for Atom is easy and encouraged to customise the text editor to suit your needs. Your packages can have node dependencies and the entire project is OpenSourced.

Swift Debugger is a small atom package I wrote which will run the swift build command then start lldb with the executable as argument bringing compiling and debugging of swift packages right inside Atom’s UI. You can toggle breakpoints in your files visually with a shortcut and the lldb will apply those breakpoints and break at those lines.

Since Atom works on Mac and Linux, the swift-debugger package also works on both.

Tutorial

Lets create a small swift project and try the debugger on a ubuntu machine. First install Atom if you don’t already have it. Then type this command on terminal :

$ apm install swift-debugger language-swift

Installing swift-debugger to /home/aciid/.atom/packages ✓

Installing language-swift to /home/aciid/.atom/packages ✓

apm is Atom Package Manager which will fetch the latest version of the swift-debugger and install it. (language-swift is a package to provide syntax highlighting)

Now enter this to create a simple swift package

$ mkdir MySwiftProject && touch MySwiftProject/main.swift && touch MySwiftProject/Package.swift

Now open this folder in atom using command line or open atom and browse to the folder you created.