Closed antonsviridov-src closed 1 month ago
Thanks for reporting! I agree that currently it's not really useful unless the class name is quite specific, I would have to improve the heuristic a lot, which was on my mind, but never got around to it. I will see if I can do it soon, otherwise I will disable it.
Ok, I changed the fallback to only work when we can find an exact symbol https://github.com/scalameta/metals/pull/6642
This should reduce false positives to a minimum of few edge cases.
You should be able to test out the new behaviour in snapshot versions, but the heuristic will be a lot more strict now.
Describe the bug
In this screenshot I purposefully broke the project and then did "go to definition" on
Version
.You can see several unrelated noisy suggestions, which aren't helpful at all.
Expected behavior
Frankly this fallback behaviour has never been useful. It either takes you to a completely unrelated location (often in javalib), or shows you tons of random options for commonly used names.
After using Metals exclusively for many years this is the one behaviour I never found to be useful, and it actively annoys me.
Instead it would be preferable for Metals to respond with no definition if it genuinely can't find one, and optionally try to self-diagnose (is the project compiling? are there semanticdb files missing? does presentation compiler knows what this thing is?)
Operating system
None
Editor/Extension
None
Version of Metals
v1.3.4
Extra context or search terms
go to definition, fallback