Coder Social home page Coder Social logo

solargraph's Introduction

Solargraph

IDE tools for the Ruby language.

Solargraph is a set of tools to integrate Ruby code completion and inline documentation into IDEs.

Online Demo

A web-based demonstration of Solargraph is available at http://solargraph.org/demo.

Installation

Solargraph is available as a Ruby gem:

gem install solargraph

Using Solargraph

Plug-ins and extensions are available for the following editors:

Gem Support

Solargraph is capable of providing code completion and documentation for gems that have YARD documentation. You can make sure your gems are documented by running yard gems from the command line. (The first time you run it might take a while if you have a lot of gems installed).

When editing code, a require call that references a gem will pull the documentation into the code maps and include the gem's API in code completion and intellisense.

More Information

See http://solargraph.org/tips for more tips on using Solargraph with an editor.

How It Works

Solargraph uses parser for code analysis and YARD for API documentation.

Using the solargraph Executable

The gem includes an executable that provides access to the library's features. For code completion, IDEs will typically integrate using solargraph stdio or solargraph socket.

Language Server Protocol

The language server protocol is the recommended way for integrating Solargraph into editors and IDEs. Clients can connect using either stdio or TCP. See LANGUAGE_SERVER.md for more information.

The Solargraph gem ships with documentation for Ruby 2.2.2. As of gem version 0.15.0, there's an option to download additional documentation for other Ruby versions from the command line.

$ solargraph list-cores      # List the installed documentation versions
$ solargraph available-cores # List the versions available for download
$ solargraph download-core   # Install the best match for your Ruby version
$ solargraph clear-cores     # Clear the documentation cache

Solargraph and Bundler

If you're using the Solargraph language server with a project that uses Bundler, the most comprehensive way to use your bundled gems is to bundle Solargraph.

In the Gemfile:

gem 'solargraph', group: :development

Run bundle install and use bundle exec yard gems to generate the documentation. This process documents cached or vendored gems, or even gems that are installed from a local path.

In order to access the gems in your project, you'll need to start the language server with Bundler. In VS Code, there's a solargraph.useBundler option. Other clients will vary, but the command you probably want to run is bundle exec solargraph socket or bundle exec solargraph stdio.

Runtime Suggestions (EXPERIMENTAL)

As of gem version 0.15.0, Solargraph includes experimental support for plugins.

The Runtime plugin enhances code completion by querying namespaces for method names in a subprocess. If it finds any undocumented or "magic" methods, they get added to the suggestions.

This feature is currently disabled by default. If you'd like to try it, you can enable it by setting the plugins section in your project's .solargraph.yml file:

plugins:
- runtime

Contributing to Solargraph

Bug Reports and Feature Requests

GitHub Issues are the best place to ask questions, report problems, and suggest improvements.

Development

Code contributions are always appreciated. Feel free to fork the repo and submit pull requests. Check for open issues that could use help. Start new issues to discuss changes that have a major impact on the code or require large time commitments.

Sponsorship and Donation

Use Patreon to support ongoing development of Solargraph at https://www.patreon.com/castwide.

You can also make one-time donations via PayPal at https://www.paypal.me/castwide.

solargraph's People

Contributors

castwide avatar jhstatewide avatar sam-killgallon avatar mattn avatar xeals avatar andybay avatar atul9 avatar douglascamata avatar gmcabrita avatar grddev avatar jonknapp avatar solawing avatar steiley avatar blue0513 avatar calos0921 avatar piktur avatar efueger avatar grunxen 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.