chore: remove a lot of deprecated stuff (#1399)
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
|
||||
local a = vim.api
|
||||
|
||||
local log = require "telescope.log"
|
||||
local config = require "telescope.config"
|
||||
local state = require "telescope.state"
|
||||
local utils = require "telescope.utils"
|
||||
@@ -27,52 +26,10 @@ local resolver = require "telescope.config.resolve"
|
||||
|
||||
local actions = setmetatable({}, {
|
||||
__index = function(_, k)
|
||||
-- TODO(conni2461): Remove deprecated messages
|
||||
if k:find "goto_file_selection" then
|
||||
error(
|
||||
"`"
|
||||
.. k
|
||||
.. "` is removed and no longer usable. "
|
||||
.. "Use `require('telescope.actions').select_` instead. Take a look at developers.md for more Information."
|
||||
)
|
||||
elseif k == "_goto_file_selection" then
|
||||
error(
|
||||
"`_goto_file_selection` is deprecated and no longer replaceable. "
|
||||
.. "Use `require('telescope.actions.set').edit` instead. Take a look at developers.md for more Information."
|
||||
)
|
||||
end
|
||||
|
||||
error("Key does not exist for 'telescope.actions': " .. tostring(k))
|
||||
end,
|
||||
})
|
||||
|
||||
-- TODO(conni2461): Remove deprecated messages
|
||||
local action_is_deprecated = function(name, err)
|
||||
local messager = err and error or log.info
|
||||
|
||||
return messager(
|
||||
string.format("`actions.%s()` is deprecated." .. "Use require('telescope.actions.state').%s() instead", name, name)
|
||||
)
|
||||
end
|
||||
|
||||
function actions.get_selected_entry()
|
||||
-- TODO(1.0): Remove
|
||||
action_is_deprecated "get_selected_entry"
|
||||
return action_state.get_selected_entry()
|
||||
end
|
||||
|
||||
function actions.get_current_line()
|
||||
-- TODO(1.0): Remove
|
||||
action_is_deprecated "get_current_line"
|
||||
return action_state.get_current_line()
|
||||
end
|
||||
|
||||
function actions.get_current_picker(prompt_bufnr)
|
||||
-- TODO(1.0): Remove
|
||||
action_is_deprecated "get_current_picker"
|
||||
return action_state.get_current_picker(prompt_bufnr)
|
||||
end
|
||||
|
||||
--- Move the selection to the next entry
|
||||
---@param prompt_bufnr number: The prompt bufnr
|
||||
function actions.move_selection_next(prompt_bufnr)
|
||||
|
||||
Reference in New Issue
Block a user