Giter Club home page Giter Club logo

ruby-lsp-rails's Introduction

Ruby DX Slack

Ruby LSP Rails

Ruby LSP Rails is a Ruby LSP addon for extra Rails editor features, such as:

  • Hover over an ActiveRecord model to reveal its schema.
  • Run or debug a test by clicking on the code lens which appears above the test class, or an individual test.
  • Navigate to associations, validations, callbacks and test cases using your editor's "Go to Symbol" feature, or outline view.
  • Jump to the definition of callbacks using your editor's "Go to Definition" feature.
  • Jump to the declaration of a route.

Installation

If you haven't already done so, you'll need to first set up Ruby LSP.

As of v0.3.0, Ruby LSP will automatically include the Ruby LSP Rails addon in its custom bundle when a Rails app is detected. There is no need to add the gem to your bundle.

Documentation

See the documentation for more in-depth details about the supported features.

How Runtime Introspection Works

LSP tooling is typically based on static analysis, but ruby-lsp-rails actually communicates with your Rails app for some features.

When Ruby LSP Rails starts, it spawns a rails runner instance which runs server.rb. The addon communicates with this process over a pipe (i.e. stdin and stdout) to fetch runtime information about the application.

When extension is stopped (e.g. by quitting the editor), the server instance is shut down.

Note

Prior to v0.3.0, ruby-lsp-rails used a different approach which involved mounting a Rack application within the Rails app. That approach was brittle and susceptible to the application's configuration, such as routing and middleware.

Contributing

See CONTRIBUTING.md

License

The gem is available as open source under the terms of the MIT License.

ruby-lsp-rails's People

Contributors

andyw8 avatar dependabot[bot] avatar github-actions[bot] avatar vinistock avatar st0012 avatar aryan-soni avatar kaanozkan avatar earlopain avatar francisbeaudoin avatar egiurleo avatar natematykiewicz avatar gmcgibbon avatar bitwise-aiden avatar bdewater avatar beauraf avatar jenshenny avatar louim avatar r7kamura 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.