metals icon indicating copy to clipboard operation
metals copied to clipboard

Inferred type lens doesn't match hover

Open kubukoz opened this issue 4 years ago • 2 comments

Describe the bug

I encountered a situation where the inferred type being shown in a code lens doesn't match the type in the on-hover window.

To Reproduce

Steps to reproduce the behavior:

  1. Import this project in metals: https://github.com/pitgull/pitgull/tree/2e96c29483ba82b98a2a05a9842633e448e7f1a7
  2. Open src/main/scala/io/pg/actions.scala
  3. Enable inferred type hints
  4. Look at val approve's inferred type

At this time I'm not able to minimize this to a simple snippet.

Expected behavior

F[Unit] is shown

Screenshots

image

image

"Insert type" works correctly:

image

Installation:

  • Operating system: macOS
  • Editor: Visual Studio Code
  • Metals version: v0.10.0

Additional context

none

Search terms

none

kubukoz avatar Feb 26 '21 14:02 kubukoz

Checked again in 0.10.1, it's changed types again! :D

image

Update: still the case in 0.11.8+25-04b682be-SNAPSHOT.

kubukoz avatar Apr 22 '21 19:04 kubukoz

Checked again in 0.10.1, it's changed types again! :D

image

This is a fun one :O

tgodzik avatar Apr 23 '21 06:04 tgodzik

I think its fine now image Could you check if it works for you?

jkciesluk avatar Dec 05 '23 16:12 jkciesluk

On the latest snapshot I don't seem to be getting any type hints at all... on 1.1.0, at the linked commit (2e96c29483ba82b98a2a05a9842633e448e7f1a7) it's still

image

but on main, with 1.1.0, it's

image

"Insert type" still works correctly. Looks like there's a lot of the []s now:

image image image

kubukoz avatar Dec 05 '23 22:12 kubukoz

@kubukoz the linked commit will not work since we no longer release for that version and we moved synthetic decorations to the presentation compiler. If you check the main with the newest snapshot you should see it works properly.

tgodzik avatar Dec 08 '23 19:12 tgodzik

Let's close this as fixed, let us know if this is still an issue after the next release.

tgodzik avatar Dec 11 '23 10:12 tgodzik