@@ -11,6 +11,8 @@ local utils = require "telescope.utils"
1111
1212local lsp = {}
1313
14+ local nvim011 = utils .nvim011
15+
1416local function call_hierarchy (opts , method , title , direction , item )
1517 vim .lsp .buf_request (opts .bufnr , method , { item = item }, function (err , result )
1618 if err then
7577--- @return lsp.TextDocumentPositionParams | TextDocumentFunction : Params to send to the server
7678local function client_position_params (win , extra )
7779 win = win or vim .api .nvim_get_current_win ()
78- if 1 ~= vim . fn . has " nvim-0.11 " then
80+ if not nvim011 then
7981 local params = vim .lsp .util .make_position_params (win )
8082 if extra then
8183 params = vim .tbl_extend (" force" , params , extra )
@@ -332,7 +334,7 @@ lsp.document_symbols = function(opts)
332334 end
333335
334336 local locations
335- if vim . fn . has " nvim-0.11 " == 1 then
337+ if nvim011 then
336338 local client = assert (vim .lsp .get_client_by_id (ctx .client_id ))
337339 locations = vim .lsp .util .symbols_to_items (result or {}, opts .bufnr , client .offset_encoding ) or {}
338340 else
@@ -382,7 +384,7 @@ lsp.workspace_symbols = function(opts)
382384 end
383385
384386 local locations
385- if vim . fn . has " nvim-0.11 " == 1 then
387+ if nvim011 then
386388 local client = assert (vim .lsp .get_client_by_id (ctx .client_id ))
387389 locations = vim .lsp .util .symbols_to_items (server_result or {}, opts .bufnr , client .offset_encoding ) or {}
388390 else
@@ -438,7 +440,7 @@ local function get_workspace_symbols_requester(bufnr, opts)
438440 if client_res .error then
439441 vim .api .nvim_err_writeln (" Error when executing workspace/symbol : " .. client_res .error .message )
440442 elseif client_res .result ~= nil then
441- if vim . fn . has " nvim-0.11 " == 1 then
443+ if nvim011 then
442444 local client = assert (vim .lsp .get_client_by_id (client_id ))
443445 vim .list_extend (locations , vim .lsp .util .symbols_to_items (client_res .result , bufnr , client .offset_encoding ))
444446 else
@@ -476,7 +478,7 @@ local function check_capabilities(method, bufnr)
476478 local clients = vim .lsp .get_clients { bufnr = bufnr }
477479
478480 for _ , client in pairs (clients ) do
479- if vim . fn . has " nvim-0.11 " == 1 then
481+ if nvim011 then
480482 if client :supports_method (method , bufnr ) then
481483 return true
482484 end
0 commit comments