mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
fix(lsp): revert change to buf.clear_references() #24238
Problem: in #24046 the signature of buf.clear_references() changed, which indirectly breaks callers that were passing "ignored" args. Solution: because util.buf_clear_references() already defaulted to "current buffer", the change to buf.clear_references() isn't actually needed, so just revert it.
This commit is contained in:
@ -1078,12 +1078,9 @@ add_workspace_folder({workspace_folder})
|
|||||||
Add the folder at path to the workspace folders. If {path} is not
|
Add the folder at path to the workspace folders. If {path} is not
|
||||||
provided, the user will be prompted for a path using |input()|.
|
provided, the user will be prompted for a path using |input()|.
|
||||||
|
|
||||||
clear_references({bufnr}) *vim.lsp.buf.clear_references()*
|
clear_references() *vim.lsp.buf.clear_references()*
|
||||||
Removes document highlights from current buffer.
|
Removes document highlights from current buffer.
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
• {bufnr} integer|nil
|
|
||||||
|
|
||||||
code_action({options}) *vim.lsp.buf.code_action()*
|
code_action({options}) *vim.lsp.buf.code_action()*
|
||||||
Selects a code action available at the current cursor position.
|
Selects a code action available at the current cursor position.
|
||||||
|
|
||||||
@ -1567,7 +1564,7 @@ buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()*
|
|||||||
Removes document highlights from a buffer.
|
Removes document highlights from a buffer.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {bufnr} (integer) Buffer id
|
• {bufnr} (integer|nil) Buffer id
|
||||||
|
|
||||||
*vim.lsp.util.buf_highlight_references()*
|
*vim.lsp.util.buf_highlight_references()*
|
||||||
buf_highlight_references({bufnr}, {references}, {offset_encoding})
|
buf_highlight_references({bufnr}, {references}, {offset_encoding})
|
||||||
|
@ -581,9 +581,8 @@ function M.document_highlight()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Removes document highlights from current buffer.
|
--- Removes document highlights from current buffer.
|
||||||
--- @param bufnr integer|nil
|
function M.clear_references()
|
||||||
function M.clear_references(bufnr)
|
util.buf_clear_references()
|
||||||
util.buf_clear_references(bufnr or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@private
|
---@private
|
||||||
|
@ -1769,9 +1769,9 @@ do --[[ References ]]
|
|||||||
|
|
||||||
--- Removes document highlights from a buffer.
|
--- Removes document highlights from a buffer.
|
||||||
---
|
---
|
||||||
---@param bufnr integer Buffer id
|
---@param bufnr integer|nil Buffer id
|
||||||
function M.buf_clear_references(bufnr)
|
function M.buf_clear_references(bufnr)
|
||||||
validate({ bufnr = { bufnr, { 'n', 'nil' }, true } })
|
validate({ bufnr = { bufnr, { 'n' }, true } })
|
||||||
api.nvim_buf_clear_namespace(bufnr or 0, reference_ns, 0, -1)
|
api.nvim_buf_clear_namespace(bufnr or 0, reference_ns, 0, -1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user