Shopify / Shopify/ruby-lsp

Ensure correct nesting inside anonymous classes or modules

Open
#2,198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We are not gathering the right nesting when an anonymous class/module is used. The context inside the body of those is different than the one inside the body of the bar method.

class Foo
  def bar
    Class.new do
      baz
    end
  end
end

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 tracing how the Ruby LSP gathers nesting for the anonymous Class.new body in the example, comparing it with the surrounding bar method context. Done means the anonymous class or module body reports the correct nesting distinct from the method body; the payload names no files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.