Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backwards-compatibility] Prevent error messages from incorrect usage by 3rd party plugins #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix alternative way of obtaining code action information
IsaacShelton committed Aug 2, 2024
commit c611b6ec6b88c4a85e09e382cead3145ed57d7c5
19 changes: 17 additions & 2 deletions lua/telescope/_extensions/ui-select.lua
Original file line number Diff line number Diff line change
@@ -28,8 +28,23 @@ return require("telescope").register_extension {
client_name = 0,
}
for idx, item in ipairs(items) do
local client_id = item[1]
local title = item[2].title
local client_id, title

if item[1] ~= nil and item[2] ~= nil and item[2].title ~= nil then
client_id = item[1]
title = item[2].title
elseif
item.ctx ~= nil
and item.ctx.client_id ~= nil
and item.action ~= nil
and item.action.title ~= nil
then
client_id = item.ctx.client_id
title = item.action.title
else
vim.api.nvim_err_writeln "telescope-ui-select.nvim - Failed to get code action information"
end

local client = vim.lsp.get_client_by_id(client_id)

local entry = {