aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-01-27 09:00:28 +0100
committerbfredl <bjorn.linse@gmail.com>2023-03-06 23:12:21 +0100
commit79571b92ced968ad27bee2a7515a4a04e84dbad2 (patch)
tree3e681a92b6fc113390f68ad2f39b91699e57c508 /test/functional/lua/vim_spec.lua
parented05d38d9fa643c7e562b754c6cfed8b9da5c4d8 (diff)
downloadrneovim-79571b92ced968ad27bee2a7515a4a04e84dbad2.tar.gz
rneovim-79571b92ced968ad27bee2a7515a4a04e84dbad2.tar.bz2
rneovim-79571b92ced968ad27bee2a7515a4a04e84dbad2.zip
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.
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua23
1 files changed, 23 insertions, 0 deletions
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()