2

I want to disable the capability of Visual Studio Code to display code definition, without affecting hover compiler messages.

According to this post: How to remove popup window showing function definition in VSCode I should disable "editor.parameterHints.enabled".

But after disabling it, the definition is still showing:

enter image description here

How do I disable it properly?

tribbloid
  • 4,026
  • 14
  • 64
  • 103

2 Answers2

3

Metals contributor here . The feature you're seeing is generically caled hover and it's the result of Metals implementing the textDocument/hover request as specified by LSP.

Some editors, like VSCode, trigger that request when the mouse hovers on a piece of text, and - if the server responds - they show a popup with the content of the response.

You can control this behavior in VSCode by using the editor.hover.enabled setting.

For example, if you set it to false then you won't get popups on hover anymore, and you will need to manually trigger them. The default keybinding for this should be CTRL K CTRL I (i.e. keep CTRL pressed and hit K followed by I).

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
  • Thanks a lot! But I only want to hide display of function definition in the code "first section of the pop-up", this setting `editor.hover.enabled` will hide both this and the compiler info/warning – tribbloid Jun 13 '21 at 00:44
  • Looks like this feature is pending for 3 straight years with very little progress (though several circumvention are proposed). So I'm just going to accept it: https://github.com/microsoft/language-server-protocol/issues/377 – tribbloid Aug 11 '21 at 23:52
1

It seems that bloop is responsible for this popup, it doesn't look like a function parameter popup. That means that there might be another setting besides “editor.parameterHints.enable” in one of your scala related extensions.

For example Scala (Metals) extension offers a hover, but there isn't a setting to turn it off, as far as I can tell:

enter image description here

EcksDy
  • 1,289
  • 9
  • 25