Fix namespace resolution for Foo::Bar lookups#137
Merged
Conversation
The issue was that when looking up Foo::Bar.class_method, the code was only searching for 'Bar' instead of 'Foo::Bar'. This fix finds the leftmost continuous chain of class/module names and builds the full path. Also added comprehensive tests for the scenario. Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com>
Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com>
- Clarify line number comments in tests (explicitly state 0-indexed) - Add proper checksums to Gemfile.lock for x86_64-linux platform Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix scope finding for Foo::Bar class
Fix namespace resolution for Foo::Bar lookups
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Namespace scope resolution was broken for references like
Foo::Bar.class_method- it would search forBarinstead of the full pathFoo::Bar, returning incorrect or missing definitions.Changes
lib/ruby_language_server/project_manager.rb: Modified
possible_definitionsto build scope paths from the leftmost continuous chain of class/module names rather than just the rightmost indexspec/lib/ruby_language_server/project_manager_spec.rb: Added tests for
Foo::Barclass lookup andFoo::Bar.class_methodmethod lookupDockerfile: Switched from
ruby:4.0-alpinetoruby:4.0-slimto resolve Alpine repository TLS errors blocking CIOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.