Issue with cmp #16
-
Hi, I recently wanted to switch from CoC to the native I'm having issues setting up the completion. use {
'junnplus/nvim-lsp-setup',
requires = {
'neovim/nvim-lspconfig',
'williamboman/nvim-lsp-installer',
'hrsh7th/cmp-nvim-lsp'
},
config = function () require 'plugins.nvim-lsp-setup' end
} then I run local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require 'cmp_nvim_lsp'.update_capabilities(capabilities)
require 'nvim-lsp-setup'.setup {
capabilities = capabilities,
servers = {
clojure_lsp = {}
}
} Now every time I enter
From What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Should I install |
Beta Was this translation helpful? Give feedback.
-
Right now I have this use {
'junnplus/nvim-lsp-setup',
requires = {
'neovim/nvim-lspconfig',
'williamboman/nvim-lsp-installer',
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp'
},
config = function () require 'plugins.nvim-lsp-setup' end
} local cmp = require 'cmp'
cmp.setup {
window = {
completion = cmp.config.window.bordered()
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' }
}, {
{ name = 'buffer' }
})
}
require 'nvim-lsp-setup'.setup {
servers = {
clojure_lsp = {}
}
} but when I open any Clojure file I can't see any completion |
Beta Was this translation helpful? Give feedback.
-
It's fine for me. You need to check |
Beta Was this translation helpful? Give feedback.
-
In a Clojure file, running
and
and on |
Beta Was this translation helpful? Give feedback.
-
See: Not found. Searched for: root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git"). https://clojure-lsp.io/troubleshooting/#classpath-scan-error You can try opening a file on contains .git dir. |
Beta Was this translation helpful? Give feedback.
-
Hey I tried it in a Leiningen project and it shows autocompletion now. Thanks! Unfortunatly I tried bot local cmp = require 'cmp'
cmp.setup {
window = {
completion = cmp.config.window.bordered()
},
mappings = cmp.mapping.preset.insert {
['<Tab>'] = cmp.mapping.select_next_item()
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' }
}, {
{ name = 'buffer' }
})
}
require 'nvim-lsp-setup'.setup {
servers = {
clojure_lsp = {}
}
} and local cmp = require 'cmp'
cmp.setup {
window = {
completion = cmp.config.window.bordered()
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' }
}, {
{ name = 'buffer' }
})
}
require 'nvim-lsp-setup'.setup {
mappings = {
['<Tab>'] = cmp.mapping.select_next_item()
},
servers = {
clojure_lsp = {}
}
} but in both ways I can't select a suggestion from the pop-up window. Is there probably something I'm misconfiguring |
Beta Was this translation helpful? Give feedback.
-
Sorry for being such a pain, I'm trying my best to make native LSP work once and for all 🥲 |
Beta Was this translation helpful? Give feedback.
-
You need using preset mapping, cmp.setup({
mapping = cmp.mapping.preset.insert()
}) You can refer to my cmp configuration: https://github.com/junnplus/dotfiles/blob/master/nvim/lua/plugins/cmp.lua#L26 You should not confuse the configuration of |
Beta Was this translation helpful? Give feedback.
-
Thanks, using your config helped me a lot. Reading that |
Beta Was this translation helpful? Give feedback.
nvim-lsp-setup
integrationcmp-nvim-lsp
by default, you just need to installcmp-nvim-lsp
, which will auto advertise capabilities to LSP servers, you should removecapabilities
from setup.