-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lspinfo): print "{cmd} --version", drop config.lspinfo #3375
Conversation
Problem: `config.lspinfo` is an undocumented feature that allows extending the info shown in `:LspInfo` (`:checkhealth lspconfig`). This feature is unwanted because: - it's undocumented - it adds a maintenance burden - it provides info that should be derived from the LSP protocol itself. Solution: Remove support for `config.lspinfo`. Instead, `:LspInfo` (`:checkhealth lspconfig`) should be enhanced to automatically gather this kind of extra info from the server response.
Note that |
local info_lines = { | ||
'filetypes: ' .. config_info.filetypes, | ||
'root directory: ' .. fmtpath(config_info.root_dir), | ||
'cmd: ' .. fmtpath(config_info.cmd), | ||
('%-18s `%s`'):format('version:', try_get_version(cmd_version)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print the cmd --version
result automatically.
--- @param cmd string[] | ||
local function try_get_version(cmd) | ||
local out = vim.fn.system(cmd) | ||
if not out then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not out then | |
if not out or vim.v.shell_error > 0 then |
do we also need this condition 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it returns any output we'll just print it, regardless of error code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea this existed. Nice.
Problem:
config.lspinfo
is an undocumented feature that allows extending the info shown in:LspInfo
(:checkhealth lspconfig
). This feature is unwanted because:Solution:
config.lspinfo
.:LspInfo
(:checkhealth lspconfig
) should be enhanced to automatically gather this kind of extra info from the server response. can :LspInfo (:checkhealth lspconfig) show more detailed info? #3376