scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Quicker access to package information #267

Open jpassaro opened 2 years ago

jpassaro commented 2 years ago

Is your feature request related to a problem? Please describe.

With this code:


import cats.data._

val regions = NonEmptyList.one("eu")

if I look at the hover data on NonEmptyList, it is not immediately apparent where the class comes from.

Describe the solution you'd like

I'd like an option, such as the one that shows implicit references and conversions, that augments the hover information with the fully qualified name of the symbol being inspected. For example in my example it would show something like

Fully qualified name:
  cats.data.NonEmptyList

or

Fully qualified name:
  cats.data.NonEmptyList$

or if I hovered the method:

Fully qualified name:
cats.data.NonEmptyList.one

It would also be really cool to have a feature that shows you in the hover where the symbol is defined, for example path to the source file on disk or within a particular jar.

Describe alternatives you've considered

This information obviously can be found by navigating to the definition or finding it in a tree view. It would be ergonomically useful to have that information without adding to the navigation stack.

Additional contex

Relates to #266 as a request for richer hover information

Search terms

fully qualified package name source path

ckipp01 commented 2 years ago

Thanks for the request @jpassaro! Just to be sure, is this what you're seeing in the hover?

Screenshot 2022-04-06 at 09 53 26

object NonEmptyList: cats.data is quite close to what you're suggesting, so I just want to ensure you're seeing that.