Shopify / Shopify/ruby-lsp

Add rename support to the `ruby-lsp`

Open
#57 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement pinned
Dominant language
Ruby
Stars
2k
Forks
281
Avg merge
2h 14m
Merged PRs (30d)
6

Description

Full support for renaming things, like method names and constants is pretty difficult and should be left for the Sorbet LSP. However, our LSP can support renaming some simple things that don't require complete type checking, like:

  • local variables
  • method/block/lambda arguments

Remember that our LSP doesn't parse every file in the code base, so our renames are limited to the current file.

Documentation: https://microsoft.github.io/language-server-protocol/specification#textDocument_rename

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Language Server Protocol textDocument/rename specification and the ruby-lsp implementation entry point for rename requests. Limit the behavior to local variables and method, block, or lambda arguments in the current file, as described in the issue. Done means these supported symbols can be renamed without requiring whole-codebase parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.