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 requested a review from rochala February 24, 2024 23:40
@natsukagami natsukagami added the area:presentation-compiler Related to the presentation compiler module used by Metals and possibly other tools label Feb 24, 2024
@natsukagami natsukagami force-pushed the 5894-range-select-method branch from 59c3bdf to 6c61433 Compare February 24, 2024 23:50
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 force-pushed the 5894-range-select-method branch from 6c61433 to 9f61ed5 Compare February 26, 2024 12:49
@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