Skip to content

Commit

Permalink
cleanup legacy codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Sep 15, 2024
1 parent ed58168 commit 57bdb79
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ e.g.
move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating window
-- e.g. move_cursor_key = '<M-p>',
-- once moved to floating window, you can use <M-d>, <M-u> to move cursor up and down
keymaps = {} -- relate to move_cursor_key; the keymaps inside floating window
keymaps = {} -- relate to move_cursor_key; the keymaps inside floating window with arguments of bufnr
-- e.g. keymaps = function(bufnr) vim.keymap.set(...) end
-- it can be function that set keymaps
-- e.g. keymaps = { { 'j', '<C-o>j' }, } this map j to <C-o>j in floating window
-- <M-d> and <M-u> are default keymaps to move cursor up and down
}
Expand Down
5 changes: 2 additions & 3 deletions lua/lsp_signature/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ local fn = vim.fn
local special_chars = { '%', '*', '[', ']', '^', '$', '(', ')', '.', '+', '-', '?', '"' }

local contains = vim.tbl_contains
-- local lsp_trigger_chars = {}

local vim_version = vim.version().major * 100 + vim.version().minor * 10 + vim.version().patch

Expand Down Expand Up @@ -184,7 +183,7 @@ helper.ft2md = function(ft)
end
end

-- location of active parameter
-- location of active parameter
-- return result, next parameter, start of next parameter, end of next parameter
helper.match_parameter = function(result, config)
-- log("match para ", result, config)
Expand Down Expand Up @@ -754,7 +753,7 @@ function helper.check_lsp_cap(clients, line_to_cursor)
total_lsp = total_lsp + 1

local h = rslv_cap.hoverProvider
if h == true or (h ~= nil and h ~= {}) then
if h == true or vim.empty(h) == 0 then
hover_cap = true
end

Expand Down
14 changes: 2 additions & 12 deletions lua/lsp_signature/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -907,20 +907,10 @@ function M.on_UpdateSignature()
signature({ trigger = 'CursorHold' })
end

M.deprecated = function(cfg)
M.validate = function(cfg)
if cfg.trigger_on_new_line ~= nil or cfg.trigger_on_nomatch ~= nil then
print('trigger_on_new_line and trigger_on_nomatch deprecated, using always_trigger instead')
end

if cfg.use_lspsaga or cfg.check_3rd_handler ~= nil then
print('lspsaga signature and 3rd handler deprecated')
end
if cfg.floating_window_above_first ~= nil then
print('use floating_window_above_cur_line instead')
end
if cfg.decorator then
print('decorator deprecated, use hi_parameter instead')
end
end

local function cleanup_logs(cfg)
Expand Down Expand Up @@ -1186,7 +1176,7 @@ M.signature_handler = signature_handler

M.setup = function(cfg)
cfg = cfg or {}
M.deprecated(cfg)
M.validate(cfg)
log('user cfg:', cfg)
local _start_client = vim.lsp.start_client
_LSP_SIG_VT_NS = api.nvim_create_namespace('lsp_signature_vt')
Expand Down

0 comments on commit 57bdb79

Please sign in to comment.