scalameta / metabrowse

Static site generator for code search with IDE features for Scala
https://scalameta.org/metabrowse/#/scalafix/scalafix-core/src/main/scala/scalafix/patch/Patch.scala
Apache License 2.0
107 stars 26 forks source link

Show information when hovering a symbol #26

Open jonas opened 7 years ago

jonas commented 7 years ago

By default, no information is shown when hovering a symbol. It would be nice to show at least type information by implementing the HoverProvider.

In addition, the default "show implementation" pop-up displayed when hovering and pressing Ctrl or key on Mac could also be improved by implementing the ImplementationProvider:

screen shot 2017-06-28 at 8 47 26 pm
olafurpg commented 7 years ago

I think we can add metadoc.schema.Symbol.docstring: String, which is generated by the cli. It's possible to find the docstrings attached to each definition with the AssociatedComment helper in scalameta contrib https://github.com/scalameta/scalameta/blob/master/scalameta/contrib/shared/src/main/scala/scala/meta/contrib/AssociatedComments.scala In addition, it's possible to parse the docstrings with ScaladocParser. Note that the MarkedString emitted by the HoverProvider is rendered as markdown.