vim-lsp
vim-lsp copied to clipboard
Print workspace_config with :verbose LspStatus
When trying to debug server configuration (recently for me: mattn/vim-lsp-settings/issues/542), it's useful to see the workspace_config for the server. I think this is more useful than anything else in server_info which are more session-specific (files).
This PR allows you to use :verbose LspStatus
to add the workspace_config to the output. I uses tpope/vim-scriptease's pretty printing if available (new lines and indents) and otherwise falls back to json encoding (one big line).
I can squash the changes if you'd like. Or change it from verbose to bang.
Can you past a screenshot of how the output looks like?
I have been thinking about use :CheckHealth
as an addition to verbose :LspStatus
as CheckHealth
is bundled with neovim and there is a polyfil https://github.com/rhysd/vim-healthcheck.
http://vimcasts.org/episodes/neovim-checkhealth/
Meanwhile I have filed a feature request to vim to bundle :CheckHealth
by default. https://github.com/vim/vim/issues/9838
Lua was the specific server I was trying to configure, but here's two other servers I use (where I use the default config):
with scriptease
and without
For CheckHealth, you mean implement health#lsp#check()
? From the docs, it looks like we'd use health#report_info()
since we don't actually do any error detection here. But if we had other validation (server doesn't exist for current filetype), we could print some warnings or errors.
Yes we should implement health#lsp#check()
. Problem with adding verbose log with message is that there could be lot of servers running and users will have to scroll.
Another option is to continue with :LspStatus <servername>
that prints to buffer with information but then this would similar to the healthcheck. The reason I was preferring :checkhealth
is so that we can print information about features enabled/disable which will make it easy for anyone to discover other potential issues.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I implemented checkhealth support:
I also included advice when status is "failed":
Do you want me to remove the verbose log with message? checkhealth strips out leading indentation so the workspace output doesn't look as nice, but I agree that it's better for it to get dumped to a buffer.
This looks great. Seems like there are some lint issues that needs to be fixed. Also would be good to document :Healthcheck
. Can also update debugging section.
I would also add this for vim folks.
if !has('nvim') | Plug 'rhysd/vim-healthcheck' | endif
Added documentation and included a Plug reference in the readme, but not in code since vim-plug is not mandatory. Looks like all lint checks pass now.
Merged. Thanks