Skip to content

Commit

Permalink
rpc: use class methods on nvim-0.11 (fix #211)
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Nov 30, 2024
1 parent a6460a6 commit 90d2d58
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/null-ls/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,14 @@ M.start = function(dispatchers)
return handle(method, params, nil, true)
end

local use_class_method = vim.fn.has("nvim-0.11") == 1
return {
request = request,
notify = notify,
request = use_class_method and function(_, ...)
request(...)
end or request,
notify = use_class_method and function(_, ...)
notify(...)
end or notify,
is_closing = function()
return stopped
end,
Expand Down

0 comments on commit 90d2d58

Please sign in to comment.