@@ -9,6 +9,8 @@ local utils = require "telescope.utils"
99
1010local lsp = {}
1111
12+ local nvim011 = utils .nvim011
13+
1214local function call_hierarchy (opts , method , title , direction , item )
1315 vim .lsp .buf_request (opts .bufnr , method , { item = item }, function (err , result )
1416 if err then
7375--- @return table | (fun ( client : vim.lsp.Client ): table ) parmas to send to the server
7476local function client_position_params (win , extra )
7577 win = win or vim .api .nvim_get_current_win ()
76- if vim . fn . has " nvim-0.11 " == 0 then
78+ if not nvim011 then
7779 local params = vim .lsp .util .make_position_params (win )
7880 if extra then
7981 params = vim .tbl_extend (" force" , params , extra )
@@ -330,7 +332,7 @@ lsp.document_symbols = function(opts)
330332 end
331333
332334 local locations
333- if vim . fn . has " nvim-0.11 " == 1 then
335+ if nvim011 then
334336 local client = assert (vim .lsp .get_client_by_id (ctx .client_id ))
335337 locations = vim .lsp .util .symbols_to_items (result or {}, opts .bufnr , client .offset_encoding ) or {}
336338 else
@@ -380,7 +382,7 @@ lsp.workspace_symbols = function(opts)
380382 end
381383
382384 local locations
383- if vim . fn . has " nvim-0.11 " == 1 then
385+ if nvim011 then
384386 local client = assert (vim .lsp .get_client_by_id (ctx .client_id ))
385387 locations = vim .lsp .util .symbols_to_items (server_result or {}, opts .bufnr , client .offset_encoding ) or {}
386388 else
@@ -436,7 +438,7 @@ local function get_workspace_symbols_requester(bufnr, opts)
436438 if client_res .error then
437439 vim .api .nvim_err_writeln (" Error when executing workspace/symbol : " .. client_res .error .message )
438440 elseif client_res .result ~= nil then
439- if vim . fn . has " nvim-0.11 " == 1 then
441+ if nvim011 then
440442 local client = assert (vim .lsp .get_client_by_id (client_id ))
441443 vim .list_extend (locations , vim .lsp .util .symbols_to_items (client_res .result , bufnr , client .offset_encoding ))
442444 else
@@ -474,7 +476,7 @@ local function check_capabilities(method, bufnr)
474476 local clients = vim .lsp .get_clients { bufnr = bufnr }
475477
476478 for _ , client in pairs (clients ) do
477- if vim . fn . has " nvim-0.11 " == 1 then
479+ if nvim011 then
478480 if client :supports_method (method , bufnr ) then
479481 return true
480482 end
0 commit comments