aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua')
-rw-r--r--runtime/lua/vim/_editor.lua20
-rw-r--r--runtime/lua/vim/_inspector.lua6
-rw-r--r--runtime/lua/vim/_options.lua142
-rw-r--r--runtime/lua/vim/_system.lua3
-rw-r--r--runtime/lua/vim/_watch.lua3
-rw-r--r--runtime/lua/vim/diagnostic.lua24
-rw-r--r--runtime/lua/vim/filetype.lua5
-rw-r--r--runtime/lua/vim/fs.lua1
-rw-r--r--runtime/lua/vim/highlight.lua19
-rw-r--r--runtime/lua/vim/iter.lua12
-rw-r--r--runtime/lua/vim/loader.lua8
-rw-r--r--runtime/lua/vim/lsp.lua44
-rw-r--r--runtime/lua/vim/lsp/_watchfiles.lua1
-rw-r--r--runtime/lua/vim/lsp/buf.lua14
-rw-r--r--runtime/lua/vim/lsp/codelens.lua4
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua9
-rw-r--r--runtime/lua/vim/lsp/handlers.lua3
-rw-r--r--runtime/lua/vim/lsp/inlay_hint.lua9
-rw-r--r--runtime/lua/vim/lsp/log.lua17
-rw-r--r--runtime/lua/vim/lsp/rpc.lua68
-rw-r--r--runtime/lua/vim/lsp/semantic_tokens.lua7
-rw-r--r--runtime/lua/vim/lsp/sync.lua7
-rw-r--r--runtime/lua/vim/lsp/tagfunc.lua4
-rw-r--r--runtime/lua/vim/lsp/util.lua25
-rw-r--r--runtime/lua/vim/secure.lua2
-rw-r--r--runtime/lua/vim/shared.lua83
-rw-r--r--runtime/lua/vim/treesitter.lua8
-rw-r--r--runtime/lua/vim/treesitter/dev.lua2
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua2
-rw-r--r--runtime/lua/vim/treesitter/language.lua1
-rw-r--r--runtime/lua/vim/treesitter/languagetree.lua5
-rw-r--r--runtime/lua/vim/treesitter/query.lua9
-rw-r--r--runtime/lua/vim/uri.lua24
-rw-r--r--runtime/lua/vim/version.lua3
34 files changed, 178 insertions, 416 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua
index bb0aa97a0d..4372aef7b3 100644
--- a/runtime/lua/vim/_editor.lua
+++ b/runtime/lua/vim/_editor.lua
@@ -54,6 +54,7 @@ vim._extra = {
inspect_pos = true,
}
+--- @private
vim.log = {
levels = {
TRACE = 0,
@@ -187,9 +188,7 @@ end
---@see |vim.print()|
---@see https://github.com/kikito/inspect.lua
---@see https://github.com/mpeterv/vinspect
-local function inspect(object, options) -- luacheck: no unused
- error(object, options) -- Stub for gen_vimdoc.py
-end
+vim.inspect = vim.inspect
do
local tdots, tick, got_line1, undo_started, trailing_nl = 0, 0, false, false, false
@@ -328,6 +327,7 @@ function vim.schedule_wrap(cb)
end
-- vim.fn.{func}(...)
+---@private
vim.fn = setmetatable({}, {
__index = function(t, key)
local _fn
@@ -345,10 +345,13 @@ vim.fn = setmetatable({}, {
end,
})
+--- @private
vim.funcref = function(viml_func_name)
return vim.fn[viml_func_name]
end
+local VIM_CMD_ARG_MAX = 20
+
--- Execute Vim script commands.
---
--- Note that `vim.cmd` can be indexed with a command name to return a callable function to the
@@ -389,12 +392,6 @@ end
--- If a table, executes a single command. In this case, it is an alias
--- to |nvim_cmd()| where `opts` is empty.
---@see |ex-cmd-index|
-function vim.cmd(command) -- luacheck: no unused
- error(command) -- Stub for gen_vimdoc.py
-end
-
-local VIM_CMD_ARG_MAX = 20
-
vim.cmd = setmetatable({}, {
__call = function(_, command)
if type(command) == 'table' then
@@ -435,7 +432,6 @@ vim.cmd = setmetatable({}, {
do
local validate = vim.validate
- ---@private
local function make_dict_accessor(scope, handle)
validate({
scope = { scope, 's' },
@@ -745,7 +741,6 @@ function vim._expand_pat(pat, env)
end
local keys = {}
- ---@private
local function insert_keys(obj)
for k, _ in pairs(obj) do
if type(k) == 'string' and string.sub(k, 1, string.len(match_part)) == match_part then
@@ -1008,7 +1003,6 @@ end
function vim._init_default_mappings()
-- mappings
- ---@private
local function region_chunks(region)
local chunks = {}
local maxcol = vim.v.maxcol
@@ -1020,7 +1014,6 @@ function vim._init_default_mappings()
return chunks
end
- ---@private
local function _visual_search(cmd)
assert(cmd == '/' or cmd == '?')
vim.api.nvim_feedkeys('\27', 'nx', true) -- Escape visual mode.
@@ -1037,7 +1030,6 @@ function vim._init_default_mappings()
vim.api.nvim_feedkeys(search_cmd, 'nx', true)
end
- ---@private
local function map(mode, lhs, rhs)
vim.keymap.set(mode, lhs, rhs, { desc = 'Nvim builtin' })
end
diff --git a/runtime/lua/vim/_inspector.lua b/runtime/lua/vim/_inspector.lua
index ecd39c35bc..3f7b9d2c23 100644
--- a/runtime/lua/vim/_inspector.lua
+++ b/runtime/lua/vim/_inspector.lua
@@ -56,7 +56,6 @@ function vim.inspect_pos(bufnr, row, col, filter)
}
-- resolve hl links
- ---@private
local function resolve_hl(data)
if data.hl_group then
local hlid = vim.api.nvim_get_hl_id_by_name(data.hl_group)
@@ -91,7 +90,6 @@ function vim.inspect_pos(bufnr, row, col, filter)
end
--- Convert an extmark tuple into a table
- --- @private
local function to_map(extmark)
extmark = {
id = extmark[1],
@@ -107,7 +105,6 @@ function vim.inspect_pos(bufnr, row, col, filter)
end
--- Check if an extmark overlaps this position
- --- @private
local function is_here(extmark)
return (row >= extmark.row and row <= extmark.end_row) -- within the rows of the extmark
and (row > extmark.row or col >= extmark.col) -- either not the first row, or in range of the col
@@ -148,17 +145,14 @@ function vim.show_pos(bufnr, row, col, filter)
local lines = { {} }
- ---@private
local function append(str, hl)
table.insert(lines[#lines], { str, hl })
end
- ---@private
local function nl()
table.insert(lines, {})
end
- ---@private
local function item(data, comment)
append(' - ')
append(data.hl_group, data.hl_group)
diff --git a/runtime/lua/vim/_options.lua b/runtime/lua/vim/_options.lua
index 6dbe4cf64a..d54e8b447c 100644
--- a/runtime/lua/vim/_options.lua
+++ b/runtime/lua/vim/_options.lua
@@ -92,15 +92,6 @@
---vim.v *vim.v*
--- |v:| variables.
--- Invalid or unset key returns `nil`.
----
----vim.env *vim.env*
---- Environment variables defined in the editor session.
---- See |expand-env| and |:let-environment| for the Vimscript behavior.
---- Invalid or unset key returns `nil`.
---- Example: >lua
---- vim.env.FOO = 'bar'
---- print(vim.env.TERM)
----<
---</pre>
local api = vim.api
@@ -118,7 +109,6 @@ local key_value_options = {
--- Convert a vimoption_T style dictionary to the correct OptionType associated with it.
---@return string
----@private
local function get_option_metatype(name, info)
if info.type == 'string' then
if info.flaglist then
@@ -143,6 +133,14 @@ local options_info = setmetatable({}, {
end,
})
+---Environment variables defined in the editor session.
+---See |expand-env| and |:let-environment| for the Vimscript behavior.
+---Invalid or unset key returns `nil`.
+---Example: <pre>lua
+--- vim.env.FOO = 'bar'
+--- print(vim.env.TERM)
+---</pre>
+---@param var string
vim.env = setmetatable({}, {
__index = function(_, k)
local v = vim.fn.getenv(k)
@@ -157,7 +155,6 @@ vim.env = setmetatable({}, {
end,
})
----@private
local function opt_validate(option_name, target_scope)
local scope = options_info[option_name].scope
if scope ~= target_scope then
@@ -174,7 +171,6 @@ local function opt_validate(option_name, target_scope)
end
end
----@private
local function new_buf_opt_accessor(bufnr)
return setmetatable({}, {
__index = function(_, k)
@@ -192,7 +188,6 @@ local function new_buf_opt_accessor(bufnr)
})
end
----@private
local function new_win_opt_accessor(winid, bufnr)
return setmetatable({}, {
__index = function(_, k)
@@ -253,19 +248,15 @@ end
---global value of a |global-local| option, see |:setglobal|.
---</pre>
----@addtogroup lua-vimscript
----@brief <pre>help
----vim.o *vim.o*
---- Get or set |options|. Like `:set`. Invalid key is an error.
+---Get or set |options|. Like `:set`. Invalid key is an error.
---
---- Note: this works on both buffer-scoped and window-scoped options using the
---- current buffer and window.
+---Note: this works on both buffer-scoped and window-scoped options using the
+---current buffer and window.
---
---- Example: >lua
---- vim.o.cmdheight = 4
---- print(vim.o.columns)
---- print(vim.o.foo) -- error: invalid key
----<
+---Example: <pre>lua
+--- vim.o.cmdheight = 4
+--- print(vim.o.columns)
+--- print(vim.o.foo) -- error: invalid key
---</pre>
vim.o = setmetatable({}, {
__index = function(_, k)
@@ -276,21 +267,17 @@ vim.o = setmetatable({}, {
end,
})
----@addtogroup lua-vimscript
----@brief <pre>help
----vim.go *vim.go*
---- Get or set global |options|. Like `:setglobal`. Invalid key is
---- an error.
----
---- Note: this is different from |vim.o| because this accesses the global
---- option value and thus is mostly useful for use with |global-local|
---- options.
----
---- Example: >lua
---- vim.go.cmdheight = 4
---- print(vim.go.columns)
---- print(vim.go.bar) -- error: invalid key
----<
+---Get or set global |options|. Like `:setglobal`. Invalid key is
+---an error.
+---
+---Note: this is different from |vim.o| because this accesses the global
+---option value and thus is mostly useful for use with |global-local|
+---options.
+---
+---Example: <pre>lua
+--- vim.go.cmdheight = 4
+--- print(vim.go.columns)
+--- print(vim.go.bar) -- error: invalid key
---</pre>
vim.go = setmetatable({}, {
__index = function(_, k)
@@ -301,41 +288,36 @@ vim.go = setmetatable({}, {
end,
})
----@addtogroup lua-vimscript
----@brief <pre>help
----vim.bo[{bufnr}] *vim.bo*
---- Get or set buffer-scoped |options| for the buffer with number {bufnr}.
---- Like `:set` and `:setlocal`. If [{bufnr}] is omitted then the current
---- buffer is used. Invalid {bufnr} or key is an error.
----
---- Note: this is equivalent to both `:set` and `:setlocal`.
----
---- Example: >lua
---- local bufnr = vim.api.nvim_get_current_buf()
---- vim.bo[bufnr].buflisted = true -- same as vim.bo.buflisted = true
---- print(vim.bo.comments)
---- print(vim.bo.baz) -- error: invalid key
+---Get or set buffer-scoped |options| for the buffer with number {bufnr}.
+---Like `:set` and `:setlocal`. If [{bufnr}] is omitted then the current
+---buffer is used. Invalid {bufnr} or key is an error.
+---
+---Note: this is equivalent to both `:set` and `:setlocal`.
+---
+---Example: <pre>lua
+--- local bufnr = vim.api.nvim_get_current_buf()
+--- vim.bo[bufnr].buflisted = true -- same as vim.bo.buflisted = true
+--- print(vim.bo.comments)
+--- print(vim.bo.baz) -- error: invalid key
---</pre>
+---@param bufnr integer|nil
vim.bo = new_buf_opt_accessor()
----@addtogroup lua-vimscript
----@brief <pre>help
----vim.wo[{winid}][{bufnr}] *vim.wo*
---- Get or set window-scoped |options| for the window with handle {winid} and
---- buffer with number {bufnr}. Like `:setlocal` if {bufnr} is provided, like
---- `:set` otherwise. If [{winid}] is omitted then the current window is
---- used. Invalid {winid}, {bufnr} or key is an error.
----
---- Note: only {bufnr} with value `0` (the current buffer in the window) is
---- supported.
----
---- Example: >lua
---- local winid = vim.api.nvim_get_current_win()
---- vim.wo[winid].number = true -- same as vim.wo.number = true
---- print(vim.wo.foldmarker)
---- print(vim.wo.quux) -- error: invalid key
---- vim.wo[winid][0].spell = false -- like ':setlocal nospell'
----<
+---Get or set window-scoped |options| for the window with handle {winid} and
+---buffer with number {bufnr}. Like `:setlocal` if {bufnr} is provided, like
+---`:set` otherwise. If [{winid}] is omitted then the current window is
+---used. Invalid {winid}, {bufnr} or key is an error.
+---
+---Note: only {bufnr} with value `0` (the current buffer in the window) is
+---supported.
+---
+---Example: <pre>lua
+--- local winid = vim.api.nvim_get_current_win()
+--- vim.wo[winid].number = true -- same as vim.wo.number = true
+--- print(vim.wo.foldmarker)
+--- print(vim.wo.quux) -- error: invalid key
+--- vim.wo[winid][0].spell = false -- like ':setlocal nospell'
+---
---</pre>
vim.wo = new_win_opt_accessor()
@@ -348,7 +330,6 @@ vim.wo = new_win_opt_accessor()
---@brief ]]
--- Preserves the order and does not mutate the original list
---- @private
local function remove_duplicate_values(t)
local result, seen = {}, {}
for _, v in ipairs(t) do
@@ -364,7 +345,6 @@ end
-- Check whether the OptionTypes is allowed for vim.opt
-- If it does not match, throw an error which indicates which option causes the error.
---- @private
local function assert_valid_value(name, value, types)
local type_of_value = type(value)
for _, valid_type in ipairs(types) do
@@ -383,17 +363,14 @@ local function assert_valid_value(name, value, types)
)
end
---- @private
local function passthrough(_, x)
return x
end
---- @private
local function tbl_merge(left, right)
return vim.tbl_extend('force', left, right)
end
---- @private
local function tbl_remove(t, value)
if type(value) == 'string' then
t[value] = nil
@@ -475,7 +452,6 @@ local to_vim_value = {
}
--- Convert a Lua value to a vimoption_T value
---- @private
local function convert_value_to_vim(name, info, value)
if value == nil then
return vim.NIL
@@ -591,7 +567,6 @@ local to_lua_value = {
}
--- Converts a vimoption_T style value to a Lua value
---- @private
local function convert_value_to_lua(info, option_value)
return to_lua_value[info.metatype](info, option_value)
end
@@ -618,7 +593,6 @@ local prepend_methods = {
}
--- Handles the '^' operator
---- @private
local function prepend_value(info, current, new)
return prepend_methods[info.metatype](
convert_value_to_lua(info, current),
@@ -648,7 +622,6 @@ local add_methods = {
}
--- Handles the '+' operator
---- @private
local function add_value(info, current, new)
return add_methods[info.metatype](
convert_value_to_lua(info, current),
@@ -656,7 +629,6 @@ local function add_value(info, current, new)
)
end
---- @private
local function remove_one_item(t, val)
if vim.tbl_islist(t) then
local remove_index = nil
@@ -700,16 +672,13 @@ local remove_methods = {
}
--- Handles the '-' operator
---- @private
local function remove_value(info, current, new)
return remove_methods[info.metatype](convert_value_to_lua(info, current), new)
end
---- @private
local function create_option_accessor(scope)
local option_mt
- --- @private
local function make_option(name, value)
local info = assert(options_info[name], 'Not a valid option name: ' .. name)
@@ -923,6 +892,11 @@ function Option:prepend(value) end -- luacheck: no unused
---@diagnostic disable-next-line:unused-local used for gen_vimdoc
function Option:remove(value) end -- luacheck: no unused
+---@private
vim.opt = create_option_accessor()
+
+---@private
vim.opt_local = create_option_accessor('local')
+
+---@private
vim.opt_global = create_option_accessor('global')
diff --git a/runtime/lua/vim/_system.lua b/runtime/lua/vim/_system.lua
index ff566866c0..e6dab90425 100644
--- a/runtime/lua/vim/_system.lua
+++ b/runtime/lua/vim/_system.lua
@@ -30,7 +30,6 @@ local uv = vim.uv
--- @field cmd string[]
--- @field result? SystemCompleted
----@private
---@param state SystemState
local function close_handles(state)
for _, handle in pairs({ state.handle, state.stdin, state.stdout, state.stderr }) do
@@ -128,7 +127,6 @@ function SystemObj:is_closing()
return handle == nil or handle:is_closing()
end
----@private
---@param output function|'false'
---@return uv_stream_t?
---@return function? Handler
@@ -145,7 +143,6 @@ local function setup_output(output)
return nil, nil
end
----@private
---@param input string|string[]|true|nil
---@return uv_stream_t?
---@return string|string[]?
diff --git a/runtime/lua/vim/_watch.lua b/runtime/lua/vim/_watch.lua
index 00b7416098..dc5f59f38b 100644
--- a/runtime/lua/vim/_watch.lua
+++ b/runtime/lua/vim/_watch.lua
@@ -7,7 +7,6 @@ M.FileChangeType = vim.tbl_add_reverse_lookup({
Deleted = 3,
})
----@private
--- Joins filepath elements by static '/' separator
---
---@param ... (string) The path elements.
@@ -16,7 +15,6 @@ local function filepath_join(...)
return table.concat({ ... }, '/')
end
----@private
--- Stops and closes a libuv |uv_fs_event_t| or |uv_fs_poll_t| handle
---
---@param handle (uv_fs_event_t|uv_fs_poll_t) The handle to stop
@@ -88,7 +86,6 @@ local default_poll_interval_ms = 2000
--- @field include_pattern? userdata
--- @field exclude_pattern? userdata
----@private
--- Implementation for poll, hiding internally-used parameters.
---
---@param path string
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index 093bfb631e..f0adc4104e 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -72,7 +72,6 @@ local bufs_waiting_to_update = setmetatable({}, bufnr_and_namespace_cacher_mt)
local all_namespaces = {}
----@private
local function to_severity(severity)
if type(severity) == 'string' then
return assert(
@@ -83,7 +82,6 @@ local function to_severity(severity)
return severity
end
----@private
local function filter_by_severity(severity, diagnostics)
if not severity then
return diagnostics
@@ -104,7 +102,6 @@ local function filter_by_severity(severity, diagnostics)
end, diagnostics)
end
----@private
local function count_sources(bufnr)
local seen = {}
local count = 0
@@ -119,7 +116,6 @@ local function count_sources(bufnr)
return count
end
----@private
local function prefix_source(diagnostics)
return vim.tbl_map(function(d)
if not d.source then
@@ -132,7 +128,6 @@ local function prefix_source(diagnostics)
end, diagnostics)
end
----@private
local function reformat_diagnostics(format, diagnostics)
vim.validate({
format = { format, 'f' },
@@ -146,7 +141,6 @@ local function reformat_diagnostics(format, diagnostics)
return formatted
end
----@private
local function enabled_value(option, namespace)
local ns = namespace and M.get_namespace(namespace) or {}
if ns.opts and type(ns.opts[option]) == 'table' then
@@ -160,7 +154,6 @@ local function enabled_value(option, namespace)
return {}
end
----@private
local function resolve_optional_value(option, value, namespace, bufnr)
if not value then
return false
@@ -180,7 +173,6 @@ local function resolve_optional_value(option, value, namespace, bufnr)
end
end
----@private
local function get_resolved_options(opts, namespace, bufnr)
local ns = namespace and M.get_namespace(namespace) or {}
-- Do not use tbl_deep_extend so that an empty table can be used to reset to default values
@@ -202,7 +194,6 @@ local diagnostic_severities = {
}
-- Make a map from DiagnosticSeverity -> Highlight Name
----@private
local function make_highlight_map(base_name)
local result = {}
for k in pairs(diagnostic_severities) do
@@ -243,7 +234,6 @@ local define_default_signs = (function()
end
end)()
----@private
local function get_bufnr(bufnr)
if not bufnr or bufnr == 0 then
return api.nvim_get_current_buf()
@@ -251,7 +241,6 @@ local function get_bufnr(bufnr)
return bufnr
end
----@private
local function diagnostic_lines(diagnostics)
if not diagnostics then
return {}
@@ -269,7 +258,6 @@ local function diagnostic_lines(diagnostics)
return diagnostics_by_line
end
----@private
local function set_diagnostic_cache(namespace, bufnr, diagnostics)
for _, diagnostic in ipairs(diagnostics) do
assert(diagnostic.lnum, 'Diagnostic line number is required')
@@ -284,7 +272,6 @@ local function set_diagnostic_cache(namespace, bufnr, diagnostics)
diagnostic_cache[bufnr][namespace] = diagnostics
end
----@private
local function restore_extmarks(bufnr, last)
for ns, extmarks in pairs(diagnostic_cache_extmarks[bufnr]) do
local extmarks_current = api.nvim_buf_get_extmarks(bufnr, ns, 0, -1, { details = true })
@@ -306,7 +293,6 @@ local function restore_extmarks(bufnr, last)
end
end
----@private
local function save_extmarks(namespace, bufnr)
bufnr = get_bufnr(bufnr)
if not diagnostic_attached_buffers[bufnr] then
@@ -326,13 +312,11 @@ end
local registered_autocmds = {}
----@private
local function make_augroup_key(namespace, bufnr)
local ns = M.get_namespace(namespace)
return string.format('DiagnosticInsertLeave:%s:%s', bufnr, ns.name)
end
----@private
local function execute_scheduled_display(namespace, bufnr)
local args = bufs_waiting_to_update[bufnr][namespace]
if not args then
@@ -348,7 +332,6 @@ end
--- Table of autocmd events to fire the update for displaying new diagnostic information
local insert_leave_auto_cmds = { 'InsertLeave', 'CursorHoldI' }
----@private
local function schedule_display(namespace, bufnr, args)
bufs_waiting_to_update[bufnr][namespace] = args
@@ -367,7 +350,6 @@ local function schedule_display(namespace, bufnr, args)
end
end
----@private
local function clear_scheduled_display(namespace, bufnr)
local key = make_augroup_key(namespace, bufnr)
@@ -377,7 +359,6 @@ local function clear_scheduled_display(namespace, bufnr)
end
end
----@private
local function get_diagnostics(bufnr, opts, clamp)
opts = opts or {}
@@ -392,7 +373,6 @@ local function get_diagnostics(bufnr, opts, clamp)
end,
})
- ---@private
local function add(b, d)
if not opts.lnum or d.lnum == opts.lnum then
if clamp and api.nvim_buf_is_loaded(b) then
@@ -416,7 +396,6 @@ local function get_diagnostics(bufnr, opts, clamp)
end
end
- ---@private
local function add_all_diags(buf, diags)
for _, diagnostic in pairs(diags) do
add(buf, diagnostic)
@@ -450,7 +429,6 @@ local function get_diagnostics(bufnr, opts, clamp)
return diagnostics
end
----@private
local function set_list(loclist, opts)
opts = opts or {}
local open = vim.F.if_nil(opts.open, true)
@@ -474,7 +452,6 @@ local function set_list(loclist, opts)
end
end
----@private
local function next_diagnostic(position, search_forward, bufnr, opts, namespace)
position[1] = position[1] - 1
bufnr = get_bufnr(bufnr)
@@ -525,7 +502,6 @@ local function next_diagnostic(position, search_forward, bufnr, opts, namespace)
end
end
----@private
local function diagnostic_move_pos(opts, pos)
opts = opts or {}
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 33d451315d..40f72a217d 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -2,7 +2,6 @@ local api = vim.api
local M = {}
----@private
local function starsetf(ft, opts)
return {
function(path, bufnr)
@@ -2317,7 +2316,6 @@ local pattern = {
-- luacheck: pop
-- luacheck: pop
----@private
local function sort_by_priority(t)
local sorted = {}
for k, v in pairs(t) do
@@ -2341,7 +2339,6 @@ end
local pattern_sorted = sort_by_priority(pattern)
----@private
local function normalize_path(path, as_pattern)
local normal = path:gsub('\\', '/')
if normal:find('^~') then
@@ -2456,7 +2453,6 @@ function M.add(filetypes)
end
end
----@private
local function dispatch(ft, path, bufnr, ...)
local on_detect
if type(ft) == 'function' then
@@ -2483,7 +2479,6 @@ end
-- Lookup table/cache for patterns that contain an environment variable pattern, e.g. ${SOME_VAR}.
local expand_env_lookup = {}
----@private
local function match_pattern(name, path, tail, pat)
if expand_env_lookup[pat] == nil then
expand_env_lookup[pat] = pat:find('%${') ~= nil
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua
index d06dcb87cf..842767098c 100644
--- a/runtime/lua/vim/fs.lua
+++ b/runtime/lua/vim/fs.lua
@@ -218,7 +218,6 @@ function M.find(names, opts)
local matches = {}
- ---@private
local function add(match)
matches[#matches + 1] = M.normalize(match)
if #matches == limit then
diff --git a/runtime/lua/vim/highlight.lua b/runtime/lua/vim/highlight.lua
index 0eb782339c..14b0e71312 100644
--- a/runtime/lua/vim/highlight.lua
+++ b/runtime/lua/vim/highlight.lua
@@ -18,23 +18,18 @@
---<pre>vim
--- au TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}
---</pre>
----
---- <pre>help
----vim.highlight.priorities *vim.highlight.priorities*
----
---- Table with default priorities used for highlighting:
---- • `syntax`: `50`, used for standard syntax highlighting
---- • `treesitter`: `100`, used for tree-sitter-based highlighting
---- • `semantic_tokens`: `125`, used for LSP semantic token highlighting
---- • `diagnostics`: `150`, used for code analysis such as diagnostics
---- • `user`: `200`, used for user-triggered highlights such as LSP document
---- symbols or `on_yank` autocommands
----</pre>
local api = vim.api
local M = {}
+--- Table with default priorities used for highlighting:
+--- - `syntax`: `50`, used for standard syntax highlighting
+--- - `treesitter`: `100`, used for tree-sitter-based highlighting
+--- - `semantic_tokens`: `125`, used for LSP semantic token highlighting
+--- - `diagnostics`: `150`, used for code analysis such as diagnostics
+--- - `user`: `200`, used for user-triggered highlights such as LSP document
+--- symbols or `on_yank` autocommands
M.priorities = {
syntax = 50,
treesitter = 100,
diff --git a/runtime/lua/vim/iter.lua b/runtime/lua/vim/iter.lua
index 6c1afcad91..7bffcc9c20 100644
--- a/runtime/lua/vim/iter.lua
+++ b/runtime/lua/vim/iter.lua
@@ -85,7 +85,6 @@ end
--- Packed tables use this as their metatable
local packedmt = {}
----@private
local function unpack(t)
if type(t) == 'table' and getmetatable(t) == packedmt then
return _G.unpack(t, 1, t.n)
@@ -93,7 +92,6 @@ local function unpack(t)
return t
end
----@private
local function pack(...)
local n = select('#', ...)
if n > 1 then
@@ -102,7 +100,6 @@ local function pack(...)
return ...
end
----@private
local function sanitize(t)
if type(t) == 'table' and getmetatable(t) == packedmt then
-- Remove length tag
@@ -120,7 +117,6 @@ end
---@param ... any Function arguments.
---@return boolean True if the iterator stage should continue, false otherwise
---@return any Function arguments.
----@private
local function continue(...)
if select('#', ...) > 0 then
return false, ...
@@ -137,7 +133,6 @@ end
---@param ... any Arguments to apply to f
---@return boolean True if the iterator pipeline should continue, false