Closed XiangQingW closed 3 years ago
Try M-x lsp-find-definitions. Also, is the rest of functionality working fine, like M-x lsp-describe-thing-at-point
.
lsp-find-definitions also doesn't work, and it'll show the error message Not found for **
.
lsp-describe-thing-at-point works fine with some annotation.
lsp-log as follows:
[Trace - 04:41:42 PM] Sending request 'textDocument/definition - (501)'.
Params: {
"textDocument": {
"uri": "file:///Users/bob/java/spring-in-action-5-samples/ch02/tacos/src/main/java/tacos/web/DesignTacoController.java"
},
"position": {
"line": 76,
"character": 43
}
}
[Trace - 04:41:42 PM] Received notification 'window/logMessage'.
Params: {
"message": "2021 4 10 pm. 4:41:42 >> document/definition",
"type": 3
}
[Trace - 04:41:42 PM] Received response 'textDocument/definition - (501)' in 40ms.
Result: []
AFAICS your project has errors, what are they? Also, check if you have picked the proper project root, do M-x lsp-describe-session and check if the project root has pom/Gradle file.
I fix the errors, and then move the demo project from ~/bob/spring-in-action-5-samples/ch02/tacos
to ~/bob/tacos
, so that the project root is ~/bob/tacos
. The lsp-java works as expected. Thank you very much.
I'm using the latest melpa packages and latest jdtls, and Xref-find-definitions works well with the Java standard library. However, Xref-find-definitions doesn't work for third-party dependencies, and it will display the error message:![截屏2021-04-10 下午1 05 22](https://user-images.githubusercontent.com/7948384/114259151-8f4f1680-99fe-11eb-9506-e2fb957ae6b9.png)
No definitions found for **
. Thanks.