-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Test methods not working since jdtls version 1.28.0 #565
Comments
Did you try rebuilding java-debug and vscode-java-test?
|
I installed all three packages using Mason. |
Maybe mason uses incompatible packages. There's nothing to do in nvim-jdtls about this as far as I can tell |
Thanks for looking into this. Edit: The mentioned PR is actually merged and v0.40.0 is avaiable. However they don't seem to provide the extension on their github release page anymore, which is probably why we cannot access them via mason (the registry was reading those files). Edit2: For all Mason users, the current workaround is to build java-test v0.40.0 from source (as explained in the README.md). I can confirm that this version is compatible with jdtls v1.28.0 |
For Mason users this is what I did to disrupt my setup the least as possible:
That's it, relaunch nvim and you are good to go 😄
|
Following @cladera sollution worked but I did had to update the target file definition on com.microsoft.java.test.target Eclipse repository for the 4.30 version in order to solve this problem when trying to
|
@cladera solution worked for me, but for anyone allergic to installing and building locally with npm (took over 1GB...): Someone has created a mason registry with downloads for java-test. In general, that seems like a cleaner solution: mason-org/mason-registry#3083 (comment) This is how I use it in configuring --ftplugin/java.lua:
local function get_bundles()
local mason_reg = require("mason-registry")
local function get_adapter_bundle()
local pkg = mason_reg.get_package("java-debug-adapter")
local pkg_install_path = pkg:get_install_path()
local pkg_jar_glob = pkg_install_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar"
local pkg_jar = vim.fn.glob(pkg_jar_glob, 1);
return pkg_jar
end
local function get_vscode_java_test_bundles()
local pkg = mason_reg.get_package("java-test")
local pkg_install_path = pkg:get_install_path()
local pkg_jars_glob = pkg_install_path .. "/extension/server/*.jar"
local pkg_jars = vim.fn.glob(pkg_jars_glob, 1);
local pkg_jars_list = vim.split(pkg_jars, "\n")
return pkg_jars_list
end
local bundles = {
get_adapter_bundle(),
};
vim.list_extend(bundles, get_vscode_java_test_bundles())
-- vim.notify("[JAVA bundles] " .. vim.inspect(bundles))
return bundles
end
local config = {
-- cmd = { ... },
-- on_attach = ... ,
-- rood_dir = ...,
-- settings = { ... },
-- ...
-- Language server `initializationOptions`
-- You need to extend the `bundles` with paths to jar files if you want to use additional eclipse.jdt.ls plugins.
-- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
init_options = {
bundles = get_bundles(),
},
}
jdtls.start_or_attach(config) Not super clean to have in your config, but it works. |
Seems like Mason installation works fine now. |
I tried today with versions:
and I am getting the same error. |
@allancomar Have to tried java-test 0.40.0? It has been a while but IIRC the fix to my original issue was to move past 0.39.0 which you are using. The issue was that mason did not support updating to it until recently. In case you are using mason as well, try updating it. I also had to call |
LSP client configuration
Eclipse.jdt.ls version
1.28.0
Steps to Reproduce
Gradle setup:
Output of
./gradlew --version
:Dependencies
Steps to reproduce:
Expected Result
Running/picking/debugging tests work as expected.
Actual Result
A notifiaction
ERROR Error fetching test candidates: org/eclipse/jdt/ls/core/internal/hover/JavaElementLabels
appears.
Using :JdtShowLogs I could see the following:
The plugin
org/eclipse/jdt/ls/core/internal/hover/JavaElementLabels
does not exist in v.1.28.0, hence the error. It used to exist in 1.27.1. Version v.1.27.1 worked perfectly fine for me.Let me know if this is a nvim-jdtls isssue or whether I should post the issue on v.1.28.0 directly.
And thanks for the awesome plugin :-)
The text was updated successfully, but these errors were encountered: