“Insert type annotation” wrongly infers `Any` type
mberndt123 opened this issue · comments
Describe the bug
- Clone this repo: https://github.com/zio/zio-http/
- check out commit ade9245c (current
main
as of this writing) - open the project using VS Code, import project (bloop or sbt, doesn't matter)
- Remove the type annotation from
val live
inobject NettyClientDriver
, save file - use the insert type annotation feature to add the type annotation again
Metals will infer Any
instead of the correct type
Expected behavior
The inferred type should be ZLayer[NettyConfig, Nothing, NettyClientDriver]
Operating system
Linux
Editor/Extension
VS Code
Version of Metals
v1.3.1
Extra context or search terms
No response
Another issue is:
In the same file, go to line 89. Position the cursor on line 89 between the leading dot and the word customHeaders
. Trigger code completion -> works fine, you get all the right methods.
Move the cursor to line 90 between the leading dot and the word webSocketUri
. Trigger code completion -> You only get junk.
Looking into the project it seems that for both Bloop and sbt BSP it's failing. The weirdest thing is that the presentation compiler seems to be sending us errors all around 🤔
Not sure, either presentation compiler is doing something weird or we are giving it a wrong classpath somehow.