-
Notifications
You must be signed in to change notification settings - Fork 407
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
textDocument/definition and textDocument/implementation NOT returning external libraries. #3291
Comments
There's a few things to address here :
I can confirm that this should work though. See https://rgrunber.github.io/vscode/java/lsp/language/server/2023/09/18/talk-to-language-server.html for more details on how I communicate with the language server in this very basic manner. (formatted for legibility) Content-Length: 244
{
"jsonrpc": "2.0",
"id": 2,
"method": "textDocument/definition",
"params": {
"textDocument": {
"uri": "file:///home/rgrunber/git/lemminx/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/XMLLanguageServer.java"
},
"position": {
"line": 177,
"character": 5
}
}
}
Content-Length: 478
{
"jsonrpc": "2.0",
"id": 2,
"result": [
{
"uri": "jdt://contents/java.base/java.lang/Object.class?=org.eclipse.lemminx/%5C/usr%5C/lib%5C/jvm%5C/java-17-openjdk-17.0.12.0.7-2.fc40.x86_64%5C/lib%5C/jrt-fs.jar%60java.base=/javadoc_location=/https:%5C/%5C/docs.oracle.com%5C/en%5C/java%5C/javase%5C/17%5C/docs%5C/api%5C/=/=/maven.pomderived=/true=/%3Cjava.lang(Object.class",
"range": {
"start": {
"line": 37,
"character": 13
},
"end": {
"line": 37,
"character": 19
}
}
}
]
} |
The above worked! My goodness I could not find the needed setting to save my life.
|
I am unable to get results for external libraries using textDocument/definition and textDocument/implementation but CAN for my source code itself.
To simplify the attempt I copied some of the libraries to a lib folder at my project root. i.e same level as my POM file
What I have tried:
I have added to my .classpath file
I have tried editing my init-options with various setups. For example, I add absolute paths to my m2 folders for classPath and docPath but I then see errors regarding them not being found in my project. (They absolutely do exist as paths.) Current init-options are the following:
Additional (maybe relevant) details:
JDTLS Version:
Java:
I am trying to setup integration between this and my own written editor. Completion seems to work fine and returns results for things like Spring classes plus additional edits to do imports. GoTo works but only for my project files and not external/additional sources or even just the lib path created under the project holding source JARs.
I am packaging JDTLS as part of an AppImage so JDTLS_PATH is defined when that whole process runs and is extracted. I have tried sans AppImage setup with same results.
Here is how I start JDTLS. Though, note that I have played with changing the -data path to be my project root as well but that just creates a folder jdt.ls-java-project (same level as my POM) and I then get messages about my source code not being in a source directory and thus nothing resolves. config_linux gets copied from my AppImage to the user's .config path.
When I did do -data at project level the .metadata/.log file would show messages but I think they mostly tied to the issues I saw as mentioned above. When set to .config/jdtls/data/.metadata it has nothing meaningful there.
log.txt
The text was updated successfully, but these errors were encountered: