|
|
@ -13,7 +13,7 @@ local function call_hierarchy_handler(direction, err, result, ctx, cfg, error_me
|
|
|
|
log('call_hierarchy')
|
|
|
|
log('call_hierarchy')
|
|
|
|
log('call_hierarchy', direction, err, result, ctx, cfg)
|
|
|
|
log('call_hierarchy', direction, err, result, ctx, cfg)
|
|
|
|
|
|
|
|
|
|
|
|
assert(next(vim.lsp.buf_get_clients()), 'Must have a client running to use lsp_tags')
|
|
|
|
assert(next(vim.lsp.get_active_clients()), 'Must have a client running to use lsp_tags')
|
|
|
|
if err ~= nil then
|
|
|
|
if err ~= nil then
|
|
|
|
log('hierarchy error', ctx, 'dir', direction, 'result', result, 'err', err)
|
|
|
|
log('hierarchy error', ctx, 'dir', direction, 'result', result, 'err', err)
|
|
|
|
vim.notify('ERROR: ' .. error_message, vim.lsp.log_levels.WARN)
|
|
|
|
vim.notify('ERROR: ' .. error_message, vim.lsp.log_levels.WARN)
|
|
|
@ -53,7 +53,7 @@ local call_hierarchy_handler_to = partial(call_hierarchy_handler, 'to')
|
|
|
|
|
|
|
|
|
|
|
|
local function incoming_calls_handler(_, err, result, ctx, cfg)
|
|
|
|
local function incoming_calls_handler(_, err, result, ctx, cfg)
|
|
|
|
local bufnr = vim.api.nvim_get_current_buf()
|
|
|
|
local bufnr = vim.api.nvim_get_current_buf()
|
|
|
|
assert(next(vim.lsp.buf_get_clients(bufnr)), 'Must have a client running to use lsp_tags')
|
|
|
|
assert(next(vim.lsp.get_active_clients({buffer = bufnr})), 'Must have a client running to use lsp_tags' )
|
|
|
|
|
|
|
|
|
|
|
|
local results = call_hierarchy_handler_from(err, result, ctx, cfg, 'Incoming calls not found')
|
|
|
|
local results = call_hierarchy_handler_from(err, result, ctx, cfg, 'Incoming calls not found')
|
|
|
|
|
|
|
|
|
|
|
@ -71,7 +71,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function M.incoming_calls(bang, opts)
|
|
|
|
function M.incoming_calls(bang, opts)
|
|
|
|
local bufnr = vim.api.nvim_get_current_buf()
|
|
|
|
local bufnr = vim.api.nvim_get_current_buf()
|
|
|
|
assert(next(vim.lsp.buf_get_clients(bufnr)), 'Must have a client running to use lsp_tags')
|
|
|
|
assert(next(vim.lsp.get_active_clients({buffer = bufnr})), 'Must have a client running to use lsp_tags' )
|
|
|
|
-- if not lsphelper.check_capabilities("call_hierarchy") then
|
|
|
|
-- if not lsphelper.check_capabilities("call_hierarchy") then
|
|
|
|
-- return
|
|
|
|
-- return
|
|
|
|
-- end
|
|
|
|
-- end
|
|
|
@ -88,7 +88,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function M.outgoing_calls(bang, opts)
|
|
|
|
function M.outgoing_calls(bang, opts)
|
|
|
|
local bufnr = vim.api.nvim_get_current_buf()
|
|
|
|
local bufnr = vim.api.nvim_get_current_buf()
|
|
|
|
assert(next(vim.lsp.buf_get_clients(bufnr)), 'Must have a client running to use lsp_tags')
|
|
|
|
assert(next(vim.lsp.get_active_clients({buffer = bufnr})), 'Must have a client running to use lsp_tags')
|
|
|
|
local params = vim.lsp.util.make_position_params()
|
|
|
|
local params = vim.lsp.util.make_position_params()
|
|
|
|
params['levels'] = 2
|
|
|
|
params['levels'] = 2
|
|
|
|
params['callee'] = true
|
|
|
|
params['callee'] = true
|
|
|
|