Closed isvicy closed 3 years ago
Do you have a minium vimrc that can startup null-ls (without navigator) I followed the readme in nullls (with or without navigator) but vim.lsp.get_active_clients() still is empty list.
lsp.lua without navigator:
-- LSP Setup
local lsp = require("lspconfig")
local lsp_status = require("lsp-status")
local null_ls = require("null-ls")
lsp_status.register_progress()
local on_attach = function(client, bufnr)
require("lsp_signature").on_attach({
bind = true,
hint_enable = true,
handler_opts = { border = "shadow" },
})
lsp_status.on_attach(client, bufnr)
end
-- Null ls
null_ls.config({
sources = {
null_ls.builtins.formatting.stylua.with({
args = {
"--indent-type",
"Spaces",
"-",
},
}),
null_ls.builtins.formatting.prettierd.with({
filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"css",
"html",
"json",
"yaml",
"markdown",
"vimwiki",
},
}),
},
})
lsp["null-ls"].setup({
on_attach = on_attach,
capabilities = lsp_status.capabilities,
})
it's basicly same as the one with navigator. the output of lspInfo with this configure is like this:
I can not reproduce.
call plug#begin('~/.vim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' }
Plug 'ray-x/navigator.lua'
Plug 'nvim-lua/plenary.nvim'
Plug 'jose-elias-alvarez/null-ls.nvim'
call plug#end()
lua <<EOF
require 'navigator'.setup{debug = true}
local null_ls = require("null-ls")
null_ls.config({
sources = {
null_ls.builtins.formatting.gofumpt,
},
})
require("lspconfig")["null-ls"].setup({})
EOF
set mouse=a
set number
If I trying to save a golang file, nvim will ask which formatter would I choose, gopls or null-ls. I choose null-ls, it will format with gofumpt.
it could happen when using a null-ls builtin formatter, such as luastyle or prettierd in my case. luastyle and prettierd use third-party binary to do the formatting. I don't use gofumpt provided by null-ls.
I will try to figure it out myself. thanks for your help. closing the issue for now.
I am still using efm
ATM. I do not see much need to turn for null-ls. Also when you start config the null-ls, there is not much log info I can debug with (debug on/off vs efm 10 levels logs).
Also for formatter. efm is incremental. Which means less communication between neovim and efm.
after moving my lsp config to navigator, formatting of luastyle in null_ls is not working.
my navigator config:
I can't figure out what is exactly the problem is, plz help.