⛔ [DEPRECATED] Active at https://github.com/pheen/fuzzy_ruby_vscode_client
A Ruby language server with persistent storage backed by Elasticsearch. The goal of this language server is to provide reasonably accurate static analysis while staying performant for large projects.
| Features | |
|---|---|
| Definitions | Jump to definitions for methods, variables, etc. |
| Search definitions in all files. Currently Disabled while WIP. | |
| Diagnostics | Indicates issues generated with Rubocop |
| Formatting | Supports formatting only modified lines |
| Highlights | Highlight all occurrences in a document |
| References | Show where a method/variable/symbol is being used |
| Rename | Update all references to a method/variable/symbol |
1. Install the Elastic Ruby Language Server extension from the VSCode Marketplace.
2. Install Docker if needed.
3. Install the dependencies needed for the extension to interact with Docker:
> cd ~/.vscode/extensions/blinknlights.elastic-ruby-client-1.0.0/
> npm install3. Set paths the server can read. A file must be in a sub-directory of one of these paths to be accessable by the server. Configure in VSCode's settings:
"elasticRubyServer.projectPaths": [
"/Users/<name>/projects",
"/Users/<name>/a_folder/more_projects"
]
- Note: don't use your home directory as a path or docker will use a large amount of CPU %.
- Tip: add a path that includes your gems so you can use the language server when running
bundle open <gem name>. For example using rbenv:"/Users/<username>/.rbenv/versions"
5. Enable formatting on save. Only modified lines are formatted. Configure in VSCode's settings:
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications",
"[ruby]": {
"editor.defaultFormatter": "Blinknlights.elastic-ruby-client"
},
6. Activate the extension by reloading VSCode and navigating to any .rb file.
- The server's Docker image will automatically download and run before indexing the workspace.
- The status bar icon turns red while the server is busy. The tooltip displays progress:

elasticRubyServer.projectPaths. See Installation.elasticRubyServer.port. Default:8341
Peek or go to the definition of a method/variable/symbol
- Command:
Go to Definition - Keybinds:
f12cmd + click
- Supported framework definitions:
- Rails:
- belongs_to
- has_one
- has_many
- has_and_belongs_to_many
- RSpec:
- let!
- let
- Rails:
Quickly navigate to definitions anywhere in a project.
- Command:
Go to Symbol in Workspace... - Keybind:
cmd + t
Enable and configure Rubocop to highlight issues by adding .rubocop.yml to the root of a project.
Formats modified lines using a light Rubocop configuration. Duplicate changes are ignored so formatting will not be applied when undoing the automatic formatting then re-saving.
- Trigger: on save
- Command:
Format Selection - Keybind:
cmd+k cmd+f
See all occurrences of a method/variable/symbol in the current editor.
See all the locations where a method/variable/symbol is being used. Only locations in the the file being edited are shown currently.
- Command:
Go to References - Keybind:
shift + f12
Change the name of a method/variable/symbol.
- Command:
Rename Symbol - Keybind:
f2
Run commands with cmd + shift + p.
Reindex Workspacedeletes all current data for the project and starts reindexing all files.Stop Serverto shutdown the Docker container.
The server runs inside a docker container and has its own instance of Elasticsearch. Clients connect through TCP allowing multiple clients to connect to a single instance of the server.
Ruby files are converted to an AST with Parser which is serialized by the language server and indexed into Elasticsearch. Data is persisted in a named Docker volume.
Definitions are searched by storing a scope which is built for a given location using rules mimicking Ruby's variable scope. When searching with Go To the correct definitions are chosen largely based on this scope. Multiple definitions will be shown if more than one match the search criteria.
-
Check that the container is running. The image name is
blinknlights/elastic_ruby_serverwhich is ran with the nameelastic-ruby-server. You could check withdocker psor in the Docker app:







