haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.64k stars 354 forks source link

Find method references of specific class instance #2478

Open yaitskov opened 2 years ago

yaitskov commented 2 years ago

VSCode has menu item "Go to references". Applied to method instance it gives all places where method is mentioned, but don't filter by type for which instance is defined. A few methods (such us parseJSON from Aeson FromJSON) could be used in many places. So search produce a long list which doesn't help a lot. The search option should have a constraint option taking into account type to make answer more relevant. All places calling parseJSON specify required type.

Instead of command: find all parseJSON invocations Command: find all parseJSON @Foo invocations

yaitskov commented 2 years ago

This kind of search involves call graph analysis which is not always possible. Result reference list should have sub groups: definitely and probably.

michaelpj commented 7 months ago

This is made much more complicated by polymorphism: is parseJSON @a a reference to parseJSON @Foo? It could be!