diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-03-07 00:28:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 00:28:53 +0100 |
commit | 39096f48f0a632870f0792955b37dc32e77458fb (patch) | |
tree | d3771db3f27af30dfcfd67599614b610ceee688d /test/functional/lua | |
parent | 6aa5346b04d6ffbac1ba8fc5626182c16b5ad947 (diff) | |
parent | 79571b92ced968ad27bee2a7515a4a04e84dbad2 (diff) | |
download | rneovim-39096f48f0a632870f0792955b37dc32e77458fb.tar.gz rneovim-39096f48f0a632870f0792955b37dc32e77458fb.tar.bz2 rneovim-39096f48f0a632870f0792955b37dc32e77458fb.zip |
Merge pull request #13834 from bfredl/omnilua
omnifunc for builtin lua
Diffstat (limited to 'test/functional/lua')
-rw-r--r-- | test/functional/lua/command_line_completion_spec.lua | 7 | ||||
-rw-r--r-- | test/functional/lua/vim_spec.lua | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/test/functional/lua/command_line_completion_spec.lua b/test/functional/lua/command_line_completion_spec.lua index 3a5966755e..9a0d534358 100644 --- a/test/functional/lua/command_line_completion_spec.lua +++ b/test/functional/lua/command_line_completion_spec.lua @@ -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) diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index b43e5b28db..77628487ca 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -2900,6 +2900,29 @@ describe('lua stdlib', function() end) end) + it('vim.lua_omnifunc', function() + local screen = Screen.new(60,5) + screen:set_default_attr_ids { + [1] = {foreground = Screen.colors.Blue1, bold = true}; + [2] = {background = Screen.colors.WebGray}; + [3] = {background = Screen.colors.LightMagenta}; + [4] = {bold = true}; + [5] = {foreground = Screen.colors.SeaGreen, bold = true}; + } + screen:attach() + command [[ set omnifunc=v:lua.vim.lua_omnifunc ]] + + -- Note: the implementation is shared with lua command line completion. + -- More tests for completion in lua/command_line_completion_spec.lua + feed [[ivim.insp<c-x><c-o>]] + screen:expect{grid=[[ + vim.inspect^ | + {1:~ }{2: inspect }{1: }| + {1:~ }{3: inspect_pos }{1: }| + {1:~ }| + {4:-- Omni completion (^O^N^P) }{5:match 1 of 2} | + ]]} + end) end) describe('lua: builtin modules', function() |