Skip to content

Commit 90d2d58

Browse files
committed
rpc: use class methods on nvim-0.11 (fix #211)
1 parent a6460a6 commit 90d2d58

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/null-ls/rpc.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,14 @@ M.start = function(dispatchers)
132132
return handle(method, params, nil, true)
133133
end
134134

135+
local use_class_method = vim.fn.has("nvim-0.11") == 1
135136
return {
136-
request = request,
137-
notify = notify,
137+
request = use_class_method and function(_, ...)
138+
request(...)
139+
end or request,
140+
notify = use_class_method and function(_, ...)
141+
notify(...)
142+
end or notify,
138143
is_closing = function()
139144
return stopped
140145
end,

0 commit comments

Comments
 (0)