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

Add keyword support to signature match #2546

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

vinistock
Copy link
Member

Motivation

Step towards #2363

This PR continues the work on #2541 and adds support for matching keyword parameters.

Implementation

The logic becomes a bit more complicated once we start mixing positionals with keywords and splats of both types.

The important thing to keep in mind is that this is going to be used to guess which overload to show in signature help, which means we need to do partial matching. For example:

def foo(a, b); end

# We need to match all of these if we're going to present the signature
# to the user
foo
foo(1)
foo(1, 2)

Automated Tests

Added tests.

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

@andyw8 andyw8 left a comment

Choose a reason for hiding this comment

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

Nice!

lib/ruby_indexer/lib/ruby_indexer/entry.rb Outdated Show resolved Hide resolved
lib/ruby_indexer/lib/ruby_indexer/entry.rb Show resolved Hide resolved
@vinistock vinistock force-pushed the vs-add-keyword-support-signature-match branch from 4316855 to 1b7f82d Compare September 13, 2024 14:03
@vinistock vinistock force-pushed the vs-add-keyword-support-signature-match branch from 1b7f82d to 8fedda3 Compare September 13, 2024 17:22
@vinistock vinistock merged commit 35f3f92 into main Sep 13, 2024
37 checks passed
@vinistock vinistock deleted the vs-add-keyword-support-signature-match branch September 13, 2024 19:57
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.

3 participants