Skip to content

Commit e136069

Browse files
committed
rpc: use class methods on nvim-0.11 (fix #211)
1 parent 3b9990a commit e136069

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 request or function(_, ...)
138+
request(...)
139+
end,
140+
notify = use_class_method and notify or function(_, ...)
141+
notify(...)
142+
end,
138143
is_closing = function()
139144
return stopped
140145
end,

0 commit comments

Comments
 (0)