-
Hi, I have a custom config and have been trying to setup nvim-java. I'm using lazy as a package manager and I used the linkedKickstart repo as a guide to get this: return { {"neovim/nvim-lspconfig",dependencies= {'williamboman/mason.nvim','williamboman/mason-lspconfig.nvim','nvim-java/nvim-java', } }, {"williamboman/mason.nvim",opts= {},keys= { {"<leader>m","<CMD>Mason<CR>",desc="Open mason"} }, }, {"williamboman/mason-lspconfig.nvim",dependencies= {"williamboman/mason.nvim",'saghen/blink.cmp','SmiteshP/nvim-navic'},config=function()require("mason-lspconfig").setup()require("mason-lspconfig").setup_handlers({-- Default handlerfunction(server_name)require("lspconfig")[server_name].setup({capabilities=require('blink.cmp').get_lsp_capabilities(),on_attach=function(client,bufnr)ifclient.server_capabilities.documentSymbolProviderthenrequire("nvim-navic").attach(client,bufnr)require("nvim-navbuddy").attach(client,bufnr)endend })end,jdtls=function()require('java').setup({jdk= {auto_install=false, }, })require('lspconfig').jdtls.setup({settings= {java= {configuration= {runtimes= { {name="JavaSE-17",path="/usr/lib/jvm/java-17-openjdk/", }, {name="JavaSE-21",path="/usr/lib/jvm/java-21-openjdk/",default=true, } } } } } })end })require('user.plugins.lsp.keymaps')end, }, {"folke/lazydev.nvim",ft="lua",-- only load on lua filesopts= {}, },} It seems to be working fine (at least for the simple things I've tried), but I get an error every time I autocomplete from the LSP source. Here's the error: Given that the error shows up when autocompleting here's my completion config usingblink (though it has nothing specific to java): return { {'saghen/blink.cmp',-- dependencies = { 'rafamadriz/friendly-snippets' },-- use a release tag to download pre-built binariesversion='*',dependencies= { {'L3MON4D3/LuaSnip',version='*'}, },opts= {keymap= {preset='none', ['<C-space>']= {'show','show_documentation','hide_documentation'}, ['<C-e>']= {'hide'}, ['<CR>']= {'select_and_accept','fallback'}, ['<Tab>']= {'select_and_accept','fallback'}, ['<C-c>']= {'cancel','fallback'}, ['<Up>']= {'select_prev','fallback'}, ['<Down>']= {'select_next','fallback'}, ['<C-k>']= {'select_prev','fallback_to_mappings'}, ['<C-j>']= {'select_next','fallback_to_mappings'}, ['<A-k>']= {'scroll_documentation_up','fallback'}, ['<A-j>']= {'scroll_documentation_down','fallback'},-- ['<Tab>'] = { 'snippet_forward', 'fallback' },-- ['<S-Tab>'] = { 'snippet_backward', 'fallback' }, ['<C-s>']= {'show_signature','hide_signature','fallback'}, },appearance= {nerd_font_variant='mono' },snippets= {preset='luasnip'},sources= {default= {"snippets","lsp","path","buffer"},per_filetype= {sql= {'snippets','dadbod','buffer'},lua= {"lazydev","snippets","lsp","path","buffer"}, },providers= {lazydev= {name="LazyDev",module="lazydev.integrations.blink",-- make lazydev completions top priority (see `:h blink.cmp`)score_offset=100, },dadbod= {name="Dadbod",module="vim_dadbod_completion.blink"}, }, },fuzzy= {implementation="rust"},-- signature = {-- enabled = true,-- window = { show_documentation = false },-- },completion= {menu= {-- Don't automatically show the completion menu-- auto_show = false,-- nvim-cmp style menudraw= {columns= { {"label","label_description",gap=1 }, {"source_name"}, {"kind_icon","kind",gap=1 } }, } }, } }, }} Any ideas what might be the problem? Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
-
Well it's even more broken than I thought. I doesn't seem to be properly building the workspace... When first opening the project the workspace build fine, but if I for example refactor a class and change its name then it doesn't get rebuilt, so other files still see it with the old name. Then after a while the old |
BetaWas this translation helpful?Give feedback.

