if using vimplug
call plug#begin()
if has('nvim')
Plug 'neovim/nvim-lspconfig'
endif
call plug#end()
then :PlugUpdate
Because nimbleparse_lsp works both with lex/yacc files, as well as the files your that parser parses.
It requires a more complex initialization in the editor client than is typical.
The following assumes that you have set up nvim-lspconfig like the Suggested Configuration.
cp nimbleparse.lua .config/nvim/lua/
call require('nimbleparse').setup(on_attach)
passing in your on_attach
function from nvim-lspconfig, or nil if you don't use one.
nimbleparse_lsp will generate diagnostics even for multiple files, even which are not open. Beyond the builtin diagnostic support, there are neovim plugins worth looking into.
However many of them offer different variations of the same functionality.
-
telescope 👍 The
Telescope diagnostics
can show diagnostics for all files, orTelescope diagnostics bufnr=0
for the current file. -
Trouble 👍 Shows diagnostics in it separate pane.
-
NvimTree 👍
Plug 'kyazdani42/nvim-tree.lua
When configured to do so, nvim-tree will show diagnostic signs and highlight files with the appropriate color, When you leave the tree open, it will update a diagnostics change.
nnoremap <leader>t <cmd>NvimTreeToggle<cr> lua <<EOF require('nvim-tree').setup{ view = { signcolumn = "yes", }, diagnostics = { enable = true, show_on_dirs = true } } EOF
- fidget 👍 Progress above the status line.
- lsp-status Progress and diagnostic counts info on the status line.
- lualine-lsp-progress 👍 Nice unobtrusive, easy to configure.
nimbleparse_lsp only emits a few (one?) notification, when it needs to reload due to nimbleparse.toml changes. by default nvim doesn't show them though.
-
nvim-notify 👍 Add to init.vim
Plug 'rcarriga/nvim-notify/'
Add the following to nimbleparse.lua and add the key
handlers = handler_fns
to thedefault_config
table also innimbleparse.lua
require("notify").setup{} vim.notify = require('notify') local severity = { "error", "warn", "info", "info", } local handler_fns = { ["window/showMessage"] = function(err, method, params, client_id) vim.notify(method.message, severity[params.type]) end, }
It can also be configured to show progress, but currently that appears to be fairly obtrusive when used with nimbleparse (although debounce_text_changes does not currently appear to be functioning at this time which should help).
watch the log file,
:set ft?
show filetype.:LspInfo
show LSP status:lua print(vim.lsp.get_log_path())
path of log file...