build(lint): allow "bufnr" as positional param #39515

Allow `bufnr` as a positional param name because it is very common.
However as a field name, or part of a function name, it is usually
a mistake.
This commit is contained in:
Justin M. Keyes
2026-04-30 07:12:35 -04:00
committed by GitHub
parent 1e7edb2c52
commit 6195624a3f
17 changed files with 213 additions and 322 deletions

View File

@@ -77,10 +77,10 @@ function M.uri_from_fname(path)
end
---Gets a URI from a bufnr.
---@param bufnr integer
---@param buf integer
---@return string URI
function M.uri_from_bufnr(bufnr)
local fname = vim.api.nvim_buf_get_name(bufnr)
function M.uri_from_bufnr(buf)
local fname = vim.api.nvim_buf_get_name(buf)
local volume_path = fname:match('^([a-zA-Z]:).*')
local is_windows = volume_path ~= nil
local scheme ---@type string?