You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I see - plugin is not so useful at the moment (mostly because of some inconsistencies in tree structure). But it's a great beginning! I can assume you know that most of Java developers like and use that feature in other IDE. So keep on going!
Some modifications I made to my jdtls config to start it working.
I use Mason, but it doesn't have needed bundles, so you have to manually clone a repo and build it.
After that you can add it bundles like this:
local home = vim.fn.getenv("HOME")
local java_dependency_bundle = vim.split(
vim.fn.glob(home .. '/.local/share/nvim/mason/packages/vscode-java-dependency/jdtls.ext/com.microsoft.jdtls.ext.core/target/com.microso
ft.jdtls.ext.core-*.jar'),
'\n'
)
if java_dependency_bundle[1] ~= '' then
vim.list_extend(path.bundles, java_dependency_bundle)
end
Lastly you need to add plugin logic on every attach:
local function jdtls_on_attach(client, bufnr)
local root_dir = require('jdtls').setup.find_root(root_files)
require("java-deps").attach(client, bufnr, root_dir)
If there is nothing wrong here, please add this to the plugin description. I just want more people use your plugin. After that I will close this thread.
Activity
JavaHello commentedon Oct 17, 2023
The current plugin is not yet complete, only ensuring that it opens without errors.
I've added the instructions to the Readme.
{ "JavaHello/java-deps.nvim", lazy = true, ft = "java", dependencies = "mfussenegger/nvim-jdtls", config = function() require("java-deps").setup({}) end, } -- jdtls lsp attach require("java-deps").attach(client, buffer, root_dir)bedware commentedon Oct 17, 2023
Yes, I see - plugin is not so useful at the moment (mostly because of some inconsistencies in tree structure). But it's a great beginning! I can assume you know that most of Java developers like and use that feature in other IDE. So keep on going!
This is valid config for packer:
Some modifications I made to my jdtls config to start it working.
I use Mason, but it doesn't have needed bundles, so you have to manually clone a repo and build it.
After that you can add it bundles like this:
Lastly you need to add plugin logic on every attach:
To use plugin I found several commands:
If there is nothing wrong here, please add this to the plugin description. I just want more people use your plugin. After that I will close this thread.
JavaHello commentedon Oct 18, 2023
Thank you for the steps you provided, it is correct, I added it to the Readme
#4