Git Product home page Git Product logo

solargraph-arc's Introduction

Solargraph ARC

Solargraph-arc was merged in solargraph-rails. Please use that repo for issues/PR.

Solargraph Awesome Rails Completions

Features

  • fixes autocompletion for multi-level classes defined in 1 line class Foo::Bar::Baz. See castwide/solargraph#506
  • autocomplete database columns by parsing db/schema.rb
  • autocomplete of model relations
  • parsing of delegate calls
  • completions for methods generated by Devise (current_user, sign_in_and_redirect, etc)
  • better support for running solargraph outside bundle
  • better completion inside controllers. request, response, params, etc.
  • autocomplete inside routes.rb
  • autocomplete inside migrations
  • completions for methods generated by ActiveStorage
  • better ActiveRecord completions

Still, due to dynamic nature of some Rails code, not all completion candidates are returned. Things get worse when you chain methods. Without type information, Solargraph cannot deduce the object you are calling methods on.

For an up to date coverage report, please see https://github.com/alisnic/solargraph-arc/tree/master/coverage.

Supported Ruby/Rails versions

This gem currently supports:

  • Ruby 2.5, 2.6, and 2.7. Ruby 3.0 almost works
  • Rails 5 and Rails 6

Usage

  1. Install gem and make sure your editor is integrated with solargraph

    gem install solargraph-arc
    
  2. If you project does not have a solagraph config, generate one using solargraph config

  3. update your project .solargraph.yml:

    # ...
    plugins:
      - solargraph-arc
  4. if you use solargraph from bundle, don't forget to include solagraph-arc in your Gemfile

  5. IMPORTANT: Make sure yard documentation is built for your project (solargraph uses it for completions) Execute this in your project root:

    $ yard gems
    

    otherwise a lot of completions won't work

Troubleshooting

See https://solargraph.org/guides/troubleshooting

Contributing

  1. create fork and clone the repo

  2. install gem deps bundle install

  3. install dummy rails5 app deps and build its yard cache

    $ cd spec/rails5
    $ bundle install && yard gems
    $ cd ../../
    
  4. install dummy rails6 app deps and build its yard cache

    $ cd spec/rails6
    $ bundle install && yard gems
    $ cd ../../
    
  5. now tests should pass locally and you can try different changes

  6. sumbit PR

solargraph-arc's People

Contributors

alisnic avatar grncdr 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.