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

Cannot go to some classes in library org.postgresql:postgresql:42.5.0) #4568

Open
zhongwm opened this issue Oct 25, 2022 · 3 comments
Open
Labels
bug Something that is making a piece of functionality unusable java support Java support related tickets upstream-fix-needed Waiting on a fix upstream

Comments

@zhongwm
Copy link

zhongwm commented Oct 25, 2022

Describe the bug

metals vscode, project sbt version 1.7.1
depends on "org.postgresql" % "postgresql" % "42.5.0"

write a scala file, add the import
import org.postgresql.core.v3.{QueryExecutorImpl, TypeTransferModeRegistry}

Here we can go to "TypeTransferModeRegistry" source file, but cannot go to QueryExecutorImpl.

BTW Both classes are public.

Expected behavior

Classes from same dependency should all be navigable or all not

Operating system

No response

Editor/Extension

No response

Version of Metals

v0.11.9

Extra context or search terms

No response

@tgodzik
Copy link
Contributor

tgodzik commented Oct 25, 2022

Thanks for reporting! IT looks like an issue with parsing Java code, I opened an upstream issue for that: paul-hammant/qdox#128

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable upstream-fix-needed Waiting on a fix upstream java support Java support related tickets labels Oct 25, 2022
@zhongwm
Copy link
Author

zhongwm commented Oct 27, 2022

How about replacing qdox or alike javaparser with
libraryDependencies += "io.earcam.wrapped" % "jdk.compiler" % "1.8.132"
The library above can be easily forked to keep up with newest java spec.

Is it an option?
I see community java parsers qdox or javaparser.org is not much reliable, at least not at par with scala-metals.

@tgodzik
Copy link
Contributor

tgodzik commented Oct 27, 2022

I think the idea is that qdox is quite easy to use and basing on how Java LSP uses it it seems complicated https://github.com/georgewfraser/java-language-server/blob/43ffea436b9b726eb8d6721605e9c437333105b9/src/main/java/org/javacs/Parser.java

However, if you know how to make it work properly I would be happy to change the current implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable java support Java support related tickets upstream-fix-needed Waiting on a fix upstream
Projects
None yet
Development

No branches or pull requests

2 participants