-
Notifications
You must be signed in to change notification settings - Fork 389
Open
scala/scala3
#23854Labels
bugSomething that is making a piece of functionality unusableSomething that is making a piece of functionality unusablespree
Description
Describe the bug
Parameter hints (the "Trigger Parameter Hints" command) work for methods, but not for functions (not even for the apply
method of functions).
def method(x: Int, y: String): Unit =
()
val function: (x: Int, y: String) => Unit =
(_, _) => ()
def test: Unit =
method(1, "one") // Good: parameter hints work
function(1, "one") // Bad: parameter hints don't work
function.apply(1, "one") // Bad: parameter hints don't work
In each of the screenshots below, I triggered the "Trigger Parameter Hints" from the Command Palette:
Worked for method
:
Didn't work for function
or function.apply
:
Interestingly, "Trigger Suggest" (Ctrl
+ Space
) before the opening paren does show the parameter names and types, so I suppose Metals should have all the information available:
Expected behavior
Trigger Parameter Hints action should show parameter hints for functions (because it's useful 😊, but also because calling a function means calling it's apply
method).
Operating system
macOS
Editor/Extension
VS Code
Version of Metals
v1.5.3
Extra context or search terms
No response
Metadata
Metadata
Assignees
Labels
bugSomething that is making a piece of functionality unusableSomething that is making a piece of functionality unusablespree