diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
commit | 7a7f497b483cd65e340064f23ed1c73425ecba0a (patch) | |
tree | d5c99ea22a1e10300d06165f8ac96df6b0dc59e1 /runtime/lua/vim/_init_packages.lua | |
parent | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.gz rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.bz2 rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpost
Diffstat (limited to 'runtime/lua/vim/_init_packages.lua')
-rw-r--r-- | runtime/lua/vim/_init_packages.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/lua/vim/_init_packages.lua b/runtime/lua/vim/_init_packages.lua index 4a961970cc..d0bb91114e 100644 --- a/runtime/lua/vim/_init_packages.lua +++ b/runtime/lua/vim/_init_packages.lua @@ -1,5 +1,5 @@ -local pathtrails = {} -vim._so_trails = {} +local pathtrails = {} --- @type table<string,true> ta +vim._so_trails = {} --- @type string[] for s in (package.cpath .. ';'):gmatch('[^;]*;') do s = s:sub(1, -2) -- Strip trailing semicolon -- Find out path patterns. pathtrail should contain something like @@ -12,6 +12,7 @@ for s in (package.cpath .. ';'):gmatch('[^;]*;') do end end +--- @param name string function vim._load_package(name) local basename = name:gsub('%.', '/') local paths = { 'lua/' .. basename .. '.lua', 'lua/' .. basename .. '/init.lua' } @@ -55,13 +56,16 @@ vim._submodules = { inspect = true, version = true, fs = true, + glob = true, iter = true, re = true, text = true, + provider = true, } -- These are for loading runtime modules in the vim namespace lazily. setmetatable(vim, { + --- @param t table<any,any> __index = function(t, key) if vim._submodules[key] then t[key] = require('vim.' .. key) @@ -70,6 +74,7 @@ setmetatable(vim, { require('vim._inspector') return t[key] elseif vim.startswith(key, 'uri_') then + --- @type any? local val = require('vim.uri')[key] if val ~= nil then -- Expose all `vim.uri` functions on the `vim` module. @@ -83,6 +88,7 @@ setmetatable(vim, { --- <Docs described in |vim.empty_dict()| > ---@private --- TODO: should be in vim.shared when vim.shared always uses nvim-lua +--- @diagnostic disable-next-line:duplicate-set-field function vim.empty_dict() return setmetatable({}, vim._empty_dict_mt) end |