Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inference for compact namespace declarations #2569

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

vinistock
Copy link
Member

Motivation

Closes #2568

We weren't splitting the name parts from the nesting, which caused us to produce the incorrect type name Admin::User::<Class:Admin::User> as opposed to the correct singleton name Admin::User::<Class:User>.

That caused inference for self when invoking singleton methods on compact namespaces to be incorrect, which then makes completion, definition, hover and signature help not work.

Implementation

We just need to ensure that we're working with the individual name parts, so I just flat mapped the split.

Automated Tests

Added a few tests to ensure we don't regress.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Sep 19, 2024
@vinistock vinistock self-assigned this Sep 19, 2024
@vinistock vinistock requested a review from a team as a code owner September 19, 2024 14:26
@vinistock vinistock requested a review from andyw8 September 19, 2024 14:26
@vinistock vinistock enabled auto-merge (squash) September 19, 2024 14:42
@vinistock vinistock merged commit 5f70deb into main Sep 19, 2024
35 checks passed
@vinistock vinistock deleted the vs-fix-inference-for-compact-declaration branch September 19, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autocompletion doesn't work when using namespaced models
2 participants