README.md
January 25, 2023 ยท View on GitHub
VimPlug
if using vimplug
call plug#begin()
if has('nvim')
Plug 'neovim/nvim-lspconfig'
endif
call plug#end()
then :PlugUpdate
Filetypes
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.
Setting up LSP
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.
Further configuration
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.
Diagnostics
-
telescope :thumbsup: The
Telescope diagnosticscan show diagnostics for all files, orTelescope diagnostics bufnr=0for the current file. -
Trouble :thumbsup: Shows diagnostics in it separate pane.
-
NvimTree :thumbsup:
Plug 'kyazdani42/nvim-tree.luaWhen 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
Progress indication
- fidget :thumbsup: Progress above the status line.
- lsp-status Progress and diagnostic counts info on the status line.
- lualine-lsp-progress :thumbsup: Nice unobtrusive, easy to configure.
Notifications
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 :thumbsup: Add to init.vim
Plug 'rcarriga/nvim-notify/'Add the following to nimbleparse.lua and add the key
handlers = handler_fnsto thedefault_configtable also innimbleparse.luarequire("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).
Testing
watch the log file,
:set ft?show filetype.:LspInfoshow LSP status:lua print(vim.lsp.get_log_path())path of log file...