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

Automatically switch overload in signature help #2553

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

vinistock
Copy link
Member

Motivation

Closes #2363

Use the code we've been building for matching signatures to automatically detect which overload should appear in signature help based on the current arguments for a method call.

Implementation

The idea is that we now return all signatures instead of just the first one. Then we match the method call to find which signature is the one we should display.

Finally, we find the active parameter for that signature, so that it switches automatically too.

Automated Tests

Added a test.

@vinistock vinistock added enhancement New feature or request server This pull request should be included in the server gem's release notes labels Sep 13, 2024
@vinistock vinistock self-assigned this Sep 13, 2024
@vinistock vinistock requested a review from a team as a code owner September 13, 2024 20:29
@vinistock vinistock requested review from andyw8 and st0012 September 13, 2024 20:29
Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small suggestion, otherwise looks good 👍

lib/ruby_lsp/listeners/signature_help.rb Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the vs-support-overloads-in-sig-help branch from 7707120 to 223bdfb Compare September 13, 2024 21:13
@vinistock vinistock enabled auto-merge (squash) September 13, 2024 21:15
@vinistock vinistock force-pushed the vs-support-overloads-in-sig-help branch from 223bdfb to 7682a4a Compare September 13, 2024 21:16
@vinistock vinistock force-pushed the vs-support-overloads-in-sig-help branch from 7682a4a to 7208489 Compare September 13, 2024 21:17
@vinistock vinistock merged commit cc0aa56 into main Sep 13, 2024
35 checks passed
@vinistock vinistock deleted the vs-support-overloads-in-sig-help branch September 13, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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.

Show all available overloads for signature help
2 participants