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

Allow range selection on function parameter to select a parameter list #19777

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

natsukagami
Copy link
Contributor

Fixes scalameta/metals#5894.

  • Add selection range for a parameter list in a function/method.
    Given a query as
    def func(a@@: Int, b: Int)(c: Int) =
        a + b + c
    range selection will now let you choose a: Int, b: Int.
    The previous options are a: Int and the whole definition of func.
  • Add a new test for selection range on function parameters.

@natsukagami natsukagami added the area:presentation-compiler Related to the presentation compiler module used by Metals and possibly other tools label Feb 24, 2024
Copy link
Contributor

@rochala rochala left a comment

Choose a reason for hiding this comment

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

LGTM

Given a query as
```scala
def func(a@@: Int, b: Int)(c: Int) =
    a + b + c
```
range selection will now let you choose `a: Int, b: Int`.
The previous options are `a: Int` and the whole definition of `func`.
@natsukagami natsukagami merged commit 6ced15b into scala:main Feb 26, 2024
16 checks passed
@Kordyjan Kordyjan added this to the 3.4.2 milestone Mar 28, 2024
WojciechMazur added a commit that referenced this pull request Jul 2, 2024
…ameter list" to LTS (#20937)

Backports #19777 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:presentation-compiler Related to the presentation compiler module used by Metals and possibly other tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Range selection selects whole line instead of all parameters in method
3 participants