scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.08k stars 326 forks source link

Jump to definition in scala doc #5736

Closed vito-c closed 9 months ago

vito-c commented 3 years ago

I would like to be able to use jump to definition on a scala doc for example:

[[ com.some.package.MyClass#coolMethod ]]
tgodzik commented 3 years ago

Thanks for reporting! This should be possible to do using the ScaladocParser and the presentation compiler. I think it's a nice feature to work on if anyone wants to give it a go.

ckipp01 commented 2 years ago

I left this request open since it's a bit older, but here is a bit more details from a duplicate requset

Is your feature request related to a problem? Please describe. In IntelliJ when I have a scaladoc I can go-to-defintion. In Metals I cannot.

Example:

/**
 * Returns a [[scala.Double]] representing yada yada yada...
 */
def f: Double = ???

Describe the solution you'd like When I use the go-to-definition in my editor that's using Metals it should go to the definition for scala.Double in the > > above example. Again, it does in IntelliJ on CMD + click.

Search terms: ScalaDocs, go-to-definition

tgodzik commented 1 year ago

Btw. this is related to https://github.com/scalameta/metals/issues/3383 whihc I haven't managed to finish working on

carlosedp commented 11 months ago

Complementing this, it would be nice to have a command in Metals (like a right-click option) to generate the link to the method to be added to the Scaladoc link.

One tricky point is overloaded methods.

kasiaMarek commented 9 months ago

Implemented in https://github.com/scalameta/metals/pull/5730. For overloaded methods we simply find all of them.

jsatk commented 9 months ago

Happy this got done. Thank you!