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

bugfix: Show properly completions for higher order functions #5839

Closed
wants to merge 1 commit into from

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Nov 15, 2023

Previously, Scala 2 would not show anything when at f(_.@@) and f had more than one parameter. The completions from the compiler would be empty.

Now, we retry with a coma in that case.

Scala 3 was working properly.

Fixes #5836

Previously, Scala 2 would not show anything when at `f(_.@@)` and f had more than one parameter. The completions from the compiler would be empty.

Now, we retry with a coma in that case.

Scala 3 was working properly.

Fixes scalameta#5836
Copy link
Member

@jkciesluk jkciesluk left a comment

Choose a reason for hiding this comment

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

It doesn't work if the method has more than one parameter after the one with function

def foo(arg1: Int => String, arg2: Int, arg3: Int) = ???

val bar = foo(_.@) // nothing shows up     

Maybe we should check amount of parameters and insert that many commas?

Also, in this case there are no completions in

val bar = foo(_.@, , )

// but we get completions in 
val bar = foo(_.@, _, )

So maybe we should insert _ (or anything actually) in every missing parameter?

@tgodzik
Copy link
Contributor Author

tgodzik commented Nov 16, 2023

Looks like we need to fix it in the compiler :/

@tgodzik tgodzik closed this Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing dot-completion on higher-order function
2 participants