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

“Insert type annotation” wrongly infers Any type #6412

Open
mberndt123 opened this issue May 16, 2024 · 4 comments
Open

“Insert type annotation” wrongly infers Any type #6412

mberndt123 opened this issue May 16, 2024 · 4 comments
Labels
bug Something that is making a piece of functionality unusable presentation-compiler Something relating to the presentation compiler Scala 2

Comments

@mberndt123
Copy link

Describe the bug

  1. Clone this repo: https://github.com/zio/zio-http/
  2. check out commit ade9245c (current main as of this writing)
  3. open the project using VS Code, import project (bloop or sbt, doesn't matter)
  4. Remove the type annotation from val live in object NettyClientDriver, save file
  5. 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

@mberndt123
Copy link
Author

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.

@tgodzik
Copy link
Contributor

tgodzik commented May 17, 2024

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 🤔

@mberndt123
Copy link
Author

It looks mostly fine in the Metals doctor though 🤷🏻‍♂️
doctor
Perhaps it is somehow related to the sbt-projectmatrix plugin?

@tgodzik
Copy link
Contributor

tgodzik commented May 17, 2024

Not sure, either presentation compiler is doing something weird or we are giving it a wrong classpath somehow.

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable presentation-compiler Something relating to the presentation compiler Scala 2 labels May 21, 2024
@tgodzik tgodzik added this to Triage in Metals Issue Board via automation May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable presentation-compiler Something relating to the presentation compiler Scala 2
Projects
Development

No branches or pull requests

2 participants