mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
feat(lua): omnifunc for builting lua interpreter
also make implicit submodules "uri" and "_inspector" work with completion this is needed for `:lua=vim.uri_<tab>` wildmenu completion to work even before uri or _inspector functions are used.
This commit is contained in:
@@ -5,7 +5,7 @@ local eq = helpers.eq
|
||||
local exec_lua = helpers.exec_lua
|
||||
|
||||
local get_completions = function(input, env)
|
||||
return exec_lua("return {vim._expand_pat(...)}", '^' .. input, env)
|
||||
return exec_lua("return {vim._expand_pat(...)}", input, env)
|
||||
end
|
||||
|
||||
local get_compl_parts = function(parts)
|
||||
@@ -107,9 +107,12 @@ describe('nlua_expand_pat', function()
|
||||
end)
|
||||
|
||||
it('should work with lazy submodules of "vim" global', function()
|
||||
eq({{ 'inspect' }, 4 },
|
||||
eq({{ 'inspect', 'inspect_pos' }, 4 },
|
||||
get_completions('vim.inspec'))
|
||||
|
||||
eq({{ 'treesitter' }, 4 },
|
||||
get_completions('vim.treesi'))
|
||||
|
||||
eq({{ 'set' }, 11 },
|
||||
get_completions('vim.keymap.se'))
|
||||
end)
|
||||
|
Reference in New Issue
Block a user