close
Skip to content

marclove/ruby-lsp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,259 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby LSP logo

Build Status Ruby LSP extension Ruby DX Slack

Ruby LSP

The Ruby LSP is an implementation of the language server protocol for Ruby, used to improve rich features in editors. It is a part of a wider goal to provide a state-of-the-art experience to Ruby developers using modern standards for cross-editor features, documentation and debugging.

Want to discuss Ruby developer experience? Consider joining the public Ruby DX Slack workspace.

Getting Started

For VS Code users, you can start by installing the Ruby LSP extension from the VS Code marketplace.

For other editors, please refer to the EDITORS guide.

To learn more about Ruby LSP, please refer to the official documentation for supported features.

LSIF Generator

Ruby LSP includes an LSIF (Language Server Index Format) generator that pre-computes code navigation data for offline use. This is useful for:

  • Code search platforms like Sourcegraph or GitHub Code Search
  • Static documentation with code navigation features
  • CI/CD pipelines that need code intelligence without running a language server

Usage

Generate LSIF output for your project:

# Basic usage - outputs to stdout
ruby-lsp-lsif

# Write output to a file
ruby-lsp-lsif -o project.lsif

# Index a specific workspace directory
ruby-lsp-lsif -w /path/to/project -o output.lsif

# Include gem dependencies in the index
ruby-lsp-lsif --include-dependencies -o output.lsif

The LSIF generator automatically uses the Composed Bundle mechanism to access your project's dependencies, ensuring accurate indexing. No additional setup is required - just run it in your project directory.

For more information about LSIF, see the LSIF specification.

Install Locally

This makes your fork available as the ruby-lsp gem on your system:

Build and install your fork

cd /workspace/ruby-lsp
gem build ruby-lsp.gemspec
gem install ruby-lsp-*.gem

# 2. Generate LSIF for the Rails app
ruby-lsp-lsif -w ../my-ruby-gem -o ../my-ruby-gem/index.lsif

# Clean up the built gem file (optional)
rm ruby-lsp-*.gem

The installed ruby-lsp-lsif executable will now use your fork's code.

SCIP Generator

Ruby LSP also includes a SCIP (Source Code Intelligence Protocol) generator. SCIP is a code intelligence format used by Sourcegraph for cross-repository navigation and code intelligence features. The output is in protobuf binary format as defined by the SCIP schema.

Usage

Generate SCIP output for your project:

# Basic usage - outputs to stdout (binary protobuf)
ruby-lsp-scip

# Write output to a file
ruby-lsp-scip -o project.scip

# Index a specific workspace directory
ruby-lsp-scip -w /path/to/project -o output.scip

# Include gem dependencies in the index
ruby-lsp-scip --include-dependencies -o output.scip

The SCIP generator automatically uses the Composed Bundle mechanism to access your project's dependencies, ensuring accurate indexing. No additional setup is required - just run it in your project directory.

For more information about SCIP, see the SCIP repository.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/ruby-lsp. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

If you wish to contribute, see Contributing for development instructions and check out our Design and roadmap for a list of tasks to get started.

License

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

About

An opinionated language server for Ruby

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Ruby 77.8%
  • TypeScript 22.1%
  • Other 0.1%