fix: No-op keymaps when there is no provider

This commit is contained in:
hedy
2023-12-13 18:40:08 +08:00
parent 2dd9ea2f57
commit d073791f1c
3 changed files with 44 additions and 9 deletions

View File

@@ -105,6 +105,9 @@ function M.rename_symbol(sidebar)
end
local node = sidebar:_current_node()
if not node then
return false
end
-- Using fn.input so it's synchronous
local new_name = vim.fn.input({ prompt = 'New Name: ', default = node.name })
@@ -140,6 +143,9 @@ function M.show_hover(sidebar)
end
local node = sidebar:_current_node()
if not node then
return false
end
local params = {
textDocument = { uri = vim.uri_from_bufnr(sidebar.code.buf) },
position = { line = node.line, character = node.character },