-
Notifications
You must be signed in to change notification settings - Fork 330
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
improvement: show args completions for all matching overloaded methods #5287
improvement: show args completions for all matching overloaded methods #5287
Conversation
6702f91
to
b097f47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great! I found a few nitpicks and there is one part that I think might use a comment, but otherwise great job!
mtags/src/main/scala-2/scala/meta/internal/pc/completions/ArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-2/scala/meta/internal/pc/completions/ArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Show resolved
Hide resolved
b097f47
to
dcf4ba4
Compare
I'm open to suggestions on how to fix the |
I don't see anything obvious, I will try to reproduce! |
7a16f1f
to
f966f86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -15,55 +15,72 @@ trait ArgCompletions { this: MetalsGlobal => | |||
pos: Position, | |||
text: String, | |||
completions: CompletionResult | |||
) extends CompletionPosition { | |||
) extends CompletionPosition { self => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a big fan on self type aliases, but I see it's useful here.
f966f86
to
50cddda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work! All the improvements will be super useful, we can work on more later on
mtags/src/main/scala-2/scala/meta/internal/pc/completions/ArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-2/scala/meta/internal/pc/completions/ArgCompletions.scala
Show resolved
Hide resolved
mtags/src/main/scala-2/scala/meta/internal/pc/completions/ArgCompletions.scala
Show resolved
Hide resolved
mtags/src/main/scala-2/scala/meta/internal/pc/completions/ArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Outdated
Show resolved
Hide resolved
mtags/src/main/scala-3/scala/meta/internal/pc/completions/NamedArgCompletions.scala
Show resolved
Hide resolved
@@ -507,7 +501,18 @@ class CompletionArgSuite extends BaseCompletionSuite { | |||
|} | |||
|""".stripMargin, | |||
"""|x: Int | |||
|x = : Byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the future, this actually shouldn't be allowed for infix arguments, could you create an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1. added fallback for arg completions for overloaded methods in Scala 3 (previously no arg completion would be visible) 2. in Scala 2, choose the matching ones from overloaded methods and collect matching arg completions from all of those
a073513
to
033517b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
update scala3 presentation compiler with changes from scalameta/metals#5287
update scala3 presentation compiler with changes from scalameta/metals#5287 [Cherry-picked fa38cb8]
update scala3 presentation compiler with changes from scalameta/metals#5287 [Cherry-picked fa38cb8]
update scala3 presentation compiler with changes from scalameta/metals#5287 [Cherry-picked fa38cb8]
OverloadedType