feat(lua): don't complete private (_) fields after dot (.) #32690

This commit is contained in:
Maria José Solano
2025-03-02 13:44:13 -08:00
committed by GitHub
parent 65c7033cbe
commit 0a5a0efda6
2 changed files with 26 additions and 0 deletions

View File

@@ -107,6 +107,30 @@ describe('nlua_expand_pat', function()
eq({ { 'set' }, 11 }, get_completions('vim.keymap.se'))
end)
it('should exclude private fields after "."', function()
eq(
{ { 'bar' }, 4 },
get_completions('foo.', {
foo = {
_bar = true,
bar = true,
},
})
)
end)
it('should include private fields after "._"', function()
eq(
{ { '_bar' }, 4 },
get_completions('foo._', {
foo = {
_bar = true,
bar = true,
},
})
)
end)
it('should be able to interpolate globals', function()
eq(
{ {