How to create, build, run and debug a Rust program with the Atom editor?

Asik picture Asik · May 28, 2015 · Viewed 7k times · Source

I am looking for step-by-step instructions to create, build, run and debug a first Rust application inside the Atom editor.

So far I have installed the Atom editor, installed the package language-rust, and fruitlessly tried to find an option inside the editor to create a Rust "project" or "package", and my google-fu failed miserably.

Disclaimer: I am on Windows, very familiar with Visual Studio and not familiar with *nix-like development environments, but eager to try Rust.

Answer

oli_obk picture oli_obk · May 28, 2015
  1. Install the build package.
  2. Install the build-cargo package
  3. Press WindowsKeyR
  4. Enter cmd and press Return or click Ok
  5. type cd C:\path\of\your\projects\folder (if it's on another drive, type d: and press Return before using the cd command)
  6. type cargo new --bin your_project_name (there must not be a folder with the same name)
  7. close the command prompt
  8. go to the new folder in the Windows Explorer
  9. right-click the folder and select Open with Atom
  10. press CtrlAltT and select "run" from the dropdown list
  11. If you prefer Atom to automatically jump to the first error it encounters, you can change this setting in the build package's settings by activating the checkbox for "Automatically scroll on build error"
  12. If you want inline popups for errors and warnings, install the linter package.

If someone figures out debugging with Atom, that would be a tremendous help.