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
Go-to-definition should only show relevant definitions when value & type have same name #57959
Comments
Thanks for fast triaging! :-) Wouldn't it count as a bug given value |
People complain a lot if the LS doesn't show a reference they think "should" count, but it's generally understood that a human is reading this list and can decide if the found reference is one they care about or not. |
To be specific: the value |
I see, maybe having a setting or running an experiment could help with this? It seems unfortunate that ts-server has to provide incorrect results because of some people's preferences |
This sounds like a "cure worse than the disease" type situation.
I couldn't even tell you the number of times I've exported both a constant and a type with the same name because they have a relationship along these lines. Factory function and instance type, interface paired with How frequent and how problematic is the issue of pulling up a type whose name is the same as an unrelated value. I'd expect it to be both rare and inconsequential. |
π Search Terms
"go to definition", "same identifier", "value", "type"
π Version & Regression Information
Always was the case, AFAIK
β― Playground Link
https://www.typescriptlang.org/play?#code/C4TwDgpgBMULxQN4F8oFgBQmDGB7AdgM6ywIrpYYBmArvtsAJYFRUAUAhgE4DmAXDACUSKKgD0YqD1yN8PGLigATCFVmMmLFgANg2qAAsIXCIGgCKYwBuEQstXrNRKLipQARrmAGoAWhjhoDnwlKEsOABsaaF1tABooCGt8GANcGh5vMMjovShsIPxPd2gaQggQ2RTGWzBwjmwIAWBCbF8Eri5cLigAFQBlACYAdgAWAE4BAHJgSagTKmNbYEUOUIio+LcaWGri2XlS8qgOW1XQSENjCAA6KAARRhCQNKgAWwggqGmAlxhJgH5MJggA
π» Code
π Actual behavior
"Go to definition" on a param type
t
shows 2 definitions - value & type which have same name - even though the value's definition is completely irrelevant.π Expected behavior
"Go to definition" shows only relevant definition of
type t
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: