Code Monkey home page Code Monkey logo

rustycode's Introduction

Build Status

Rust for Visual Studio Code (Latest: 0.19.1)

Changelog

Roadmap

This extension adds advanced language support for the Rust language to VS Code, including:

  • Autocompletion (using racer)
  • Go To Definition (using racer)
  • Go To Symbol (using rustsym)
  • Format (using rustfmt)
  • Linter checkOnSave is experimental
  • Linting can be done via checkWith is experimental
    • check. This is the default. Runs rust compiler but skips codegen pass.
    • check-lib. As above, but is limited only to library if project has library + multiple binaries
    • clippy if cargo-clippy is installed
    • build
  • Cargo tasks (Open Command Pallete and they will be there)
  • Snippets

IDE Features

IDE

Using

First, you will need to install Visual Studio Code 1.0 or newer. In the command pallete (cmd-shift-p) select Install Extension and choose RustyCode.

Then, you need to install Racer (instructions and source code here). Please, note that we only support latest versions of Racer.

Also, you need to install Rustfmt (instructions and source code here)

And last step is downloading Rust language source files from here.

Options

The following Visual Studio Code settings are available for the RustyCode extension. These can be set in user preferences or workspace settings (.vscode/settings.json)

{
	"rust.racerPath": null, // Specifies path to Racer binary if it's not in PATH
	"rust.rustLangSrcPath": null, // Specifies path to /src directory of local copy of Rust sources
	"rust.rustfmtPath": null, // Specifies path to Rustfmt binary if it's not in PATH
	"rust.rustsymPath": null, // Specifies path to Rustsym binary if it's not in PATH
	"rust.cargoPath": null, // Specifies path to Cargo binary if it's not in PATH
	"rust.cargoHomePath": null, // Path to Cargo home directory, mostly needed for racer. Needed only if using custom rust installation.
	"rust.cargoEnv": null, // Specifies custom variables to set when running cargo. Useful for crates which use env vars in their build.rs (like openssl-sys).
	"rust.formatOnSave": false, // Turn on/off autoformatting file on save (EXPERIMENTAL)
	"rust.checkOnSave": false, // Turn on/off `cargo check` project on save (EXPERIMENTAL)
	"rust.checkWith": "build", // Specifies the linter to use. (EXPERIMENTAL)
	"rust.useJsonErrors": false, // Enable the use of JSON errors (requires Rust 1.7+). Note: This is an unstable feature of Rust and is still in the process of being stablised
	"rust.useNewErrorFormat": false, // "Use the new Rust error format (RUST_NEW_ERROR_FORMAT=true). Note: This flag is mutually exclusive with `useJsonErrors`.
}

Building and Debugging the Extension

Repository

You can set up a development enviroment for debugging the extension during extension development.

First make sure you do not have the extension installed in ~/.vscode/extensions. Then clone the repo somewhere else on your machine, run npm install and open a development instance of Code.

rm -rf ~/.vscode/extensions/RustyCode
cd ~
git clone https://github.com/saviorisdead/RustyCode
cd RustyCode
npm install
npm run-script compile
code .

You can now go to the Debug viewlet and select Launch Extension then hit run (F5). If you make edits in the extension .ts files, just reload (cmd-r) the [Extension Development Host] instance of Code to load in the new extension code. The debugging instance will automatically reattach.

License

MIT

rustycode's People

Contributors

7sharp9 avatar alessandrod avatar aochagavia avatar byron avatar crumblingstatue avatar cryze avatar draivin avatar dten avatar frederick888 avatar fulmicoton avatar henriiik avatar hivectl avatar johansja avatar juanfra684 avatar junjieliang avatar kalitaalexey avatar mooman219 avatar nlordell avatar skade avatar soaa- avatar swgillespie avatar trixnz avatar vhbit avatar w4rh4wk avatar white-oak avatar yutannihilation avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.