-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: use lspconfig.util._available_servers #14
Conversation
lua/dotfyle_metadata/extras/lsp.lua
Outdated
@@ -7,7 +7,7 @@ return function() | |||
return {} | |||
end | |||
|
|||
local servers = lspconfig.util.available_servers() | |||
local servers = lspconfig.util._available_servers() |
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.
Hey thanks for the PR!
Would you be able to keep the previous function call and do a check for the new function?
Since this change is very recent (2 days ago from today) not many users would've updated the lspconfig plugin (like myself).
I think it's best to still keep the old function for some time before we rename it completely to the new _available_servers
.
I'm thinking like the following conditional pseudocode:
- If
_available_servers
is not nil then call it - Otherwise, call
available_servers
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'm getting an error where _available_servers
is not available, If I'm in the older version of lspconfig.
I think it's best to compare if the function itself is defined instead of calling the function.
So check lspconfig.util._available_servers ~= nil
(without the braces ()
)
Then servers = lspconfig.util._available_servers()
(call the function) otherwise servers = lspconfig.util.available_servers()
lua/dotfyle_metadata/extras/lsp.lua
Outdated
@@ -7,7 +7,7 @@ return function() | |||
return {} | |||
end | |||
|
|||
local servers = lspconfig.util.available_servers() | |||
local servers = lspconfig.util._available_servers() |
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'm getting an error where _available_servers
is not available, If I'm in the older version of lspconfig.
I think it's best to compare if the function itself is defined instead of calling the function.
So check lspconfig.util._available_servers ~= nil
(without the braces ()
)
Then servers = lspconfig.util._available_servers()
(call the function) otherwise servers = lspconfig.util.available_servers()
c177f80
to
6652a77
Compare
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.
Appreciate the work you've done! o7
I've been busy and haven't been able to comment. |
This change was reverted in neovim/nvim-lspconfig#3589. |
I think it's fine to leave as it is. Not sure if they will change their minds to go back to using the |
The
lspconfig.util.available_servers
has become a private function and it no longer works.This PR will fix this.
ref: neovim/nvim-lspconfig@e118ce5
ref: folke/neoconf.nvim#105