Skip to content
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

Scaladoc when hovering on members of unmanaged jar with javadoc #376

Open
ddemange opened this issue Mar 19, 2024 · 2 comments
Open

Scaladoc when hovering on members of unmanaged jar with javadoc #376

ddemange opened this issue Mar 19, 2024 · 2 comments

Comments

@ddemange
Copy link

ddemange commented Mar 19, 2024

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

I am working with unmanaged jars that :

  • don't provide sources
  • provide only classes and javadocs (compiled from scala 3)
  • cannot be published on a repo, even locally

hovering on members of the jar only shows their types, and not their scaladoc.

The scaladoc only shows partially with autocompletion, when starting to type the name of a member (method), and it only shows for parameters.

image

Describe the solution you'd like

Hovering on any member provided by such a jar would show the complete scaladoc, like it does for members for which one has the source at hand. E.g. :

image

Describe alternatives you've considered

I am not aware of any alternative that would suit my use-case (apart from using a different IDE) :

  • I cannot get the sources of the jars (third-party library)
  • I cannot publish the jar files, even locally

Additional context

  • scala 3.3.1
  • scala Metals v1.29.0
  • sbt 1.9.2
  • vscode Version : 1.87.2 (Universal), Electron : 27.3.2

Search terms

scaladoc, hover, unmanagedJars

@tgodzik
Copy link
Contributor

tgodzik commented Mar 19, 2024

Thanks for reporting! If anyone picks it up it's worth to ask the compiler team to see if maybe there is a good way to do that.

@tgodzik
Copy link
Contributor

tgodzik commented Mar 19, 2024

Ok, so we should be able to fallback to the compiler, I did a small PoC but don't have time to confirm it.

https://github.com/scalameta/metals/compare/main...tgodzik:metals:fallback-comments?expand=1

@ddemange if you want you can try and publish locally to see if this helps for hover (we would need a small refactor to use the fallback everywhere). To do that you need:

sbt publishLocal
sbt ++3.3.1 mtagsShared/publishLocal mtags/publishLocal

then change the metals.serverVersion for you workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants