Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 574
Asik Avatar asked May 28 '15 03:05

Asik


People also ask

Does Atom support Rust?

Rust language support in Atom Adds syntax highlighting and snippets to Rust files in Atom.


1 Answers

  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.

like image 94
oli_obk Avatar answered Sep 18 '22 11:09

oli_obk