Skip to content
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: follow upstream deprecate non-method clients functions #3443

Closed
wants to merge 1 commit into from

Conversation

glepnir
Copy link
Member

@glepnir glepnir commented Nov 20, 2024

@glepnir glepnir force-pushed the method_compatiable branch 2 times, most recently from 6c53765 to 004cd23 Compare November 20, 2024 12:00
@@ -96,7 +96,7 @@ return {
commands = {
DenolsCache = {
function()
local clients = util.get_lsp_clients { bufnr = 0, name = 'denols' }
local clients = util.get_lsp_clients({ bufnr = 0, name = 'denols' })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is stylua doing this? not required by our style guide.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a bug of stylua . just run stylua ./ in shell

assert(
#julials_clients > 0,
'method julia/activateenvironment is not supported by any servers active on the current buffer'
)
local function _activate_env(environment)
if environment then
for _, julials_client in ipairs(julials_clients) do
julials_client.notify('julia/activateenvironment', { envPath = environment })
util.client_proxy(julials_client).notify('julia/activateenvironment', { envPath = environment })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not in favor of this PR if it requires client_proxy in the configs themselves. That just introduces even more migration later.

If there's a way to make it transparent to configs, that's fine. Otherwise we should just wait until we can bump the minimum required Nvim to 0.11

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The current command design is too fragile. The client is necessary here. So it is better to provide a default wrapper function with the client and bufnr as the parameter so that we can easily handle any upstream changes on the client object internally.

      switch_source_header(client, bufnr),   

@glepnir glepnir closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants