I configured the sumneko_lua LSP server from kickstart.nvim & in addition used the selene + stylua builtins of the null-ls plugin. But the issue right now is whenever I attempt to write a buffer, Neovim prompts me to choose either sumneko_lua or null-ls as the LSP.
Screenshot attached for reference:
So, how do I configure Neovim to cooperate with null-ls & sumneko_lua for my LSP needs?
NOTE: I’m using Neovim v0.7.0 (not the nightly version)
Thanks for sharing those resources, I did take a look at them & tried to fix the issue. I’m a Lua noob but here’s what I did & it still doesn’t work for whatever reasons:
local custom_on_attach = function(client, bufnr)
-- A bunch of keymaps for LSP
end
local lua_formatting_callback = function(client, bufnr)
local params = vim.lsp.util.make_formatting_params({})
client.request("textDocument/formatting", params, nil, bufnr)
end
require("lspconfig").sumneko_lua.setup({
on_attach = function(client, bufnr)
lua_formatting_callback(client, bufnr)
custom_on_attach(client, bufnr)
end,
-- For autocompletion using nvim-cmp
capabilities = capabilities
settings = {
-- Some Lua LSP settings
}
})
-- Configuration for null-ls
require("null-ls").setup({
sources = {
require("null-ls").builtins.formatting.stylua
require("null-ls").builtins.diagnostics.selene
}
})