Giter Club home page Giter Club logo

vscode-ruby's Introduction

Visual Studio Code Ruby Extension

CircleCI Build status codecov

This extension provides Ruby language and debugging support for Visual Studio Code.

Features

  • Automatic Ruby environment detection with support for rvm, rbenv, chruby, and asdf
  • Lint support via RuboCop, Standard, and Reek
  • Format support via RuboCop, Standard, Rufo, and RubyFMT
  • Semantic code folding support
  • Semantic highlighting support
  • Basic Intellisense support

Installation

Search for ruby in the VS Code Extension Gallery and install it!

Initial Configuration

By default, the extension provides sensible defaults for developers to get a better experience using Ruby in Visual Studio Code. However, these defaults do not include settings to enable features like formatting or linting. Given how dynamic Ruby projects can be (are you using rvm, rbenv, chruby, or asdf? Are your gems globally installed or via bundler? etc), the extension requires additional configuration for additional features to be available.

Using the Language Server

It is highly recommended that you enable the Ruby language server (via the Use Language Server setting or ruby.useLanguageServer config option). The server does not default to enabled while it is under development but it provides a significantly better experience than the legacy extension functionality. See docs/language-server.md for more information on the language server.

Legacy functionality will most likely not receive additional improvements and will be fully removed when the extension hits v1.0

Example Initial Configuration:

"ruby.useBundler": true, //run non-lint commands with bundle exec
"ruby.useLanguageServer": true, // use the internal language server (see below)
"ruby.lint": {
  "rubocop": {
    "useBundler": true // enable rubocop via bundler
  },
  "reek": {
    "useBundler": true // enable reek via bundler
  }
},
"ruby.format": "rubocop" // use rubocop for formatting

Reviewing the linting and formatting docs is recommended

For full details on configuration options, please take a look at the Ruby section in the VS Code settings UI. Each option is associated with a name and description.

Legacy Configuration

docs/legacy.md contains the documentation around the legacy functionality

Troubleshooting

See docs/troubleshooting.md

Other Notable Extensions

  • Ruby Solargraph - Solargraph is a language server that provides intellisense, code completion, and inline documentation for Ruby.
  • VSCode Endwise - Wisely add "end" in Ruby

vscode-ruby's People

Contributors

azemoh avatar castwide avatar connorshea avatar cyangle avatar doudou avatar gurgeous avatar hazi avatar hnioche avatar hookyqr avatar karuna avatar kematzy avatar lostintangent avatar lumean avatar mattn avatar michielboekhoff avatar mmahalwy avatar nickwarm avatar orta avatar pelted avatar perlun avatar peterzhu2118 avatar rebornix avatar remcohaszing avatar richkeenan avatar seraku24 avatar stefansedich avatar toddmazierski avatar wingrunr21 avatar yisraelv avatar ypresto 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.