aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaria José Solano <majosolano99@gmail.com>2025-03-02 13:44:13 -0800
committerGitHub <noreply@github.com>2025-03-02 13:44:13 -0800
commit0a5a0efda64ccc789cda25b90fa907f277006cd3 (patch)
treecfd6082ae005ccb1debf68483be9de450796fcf1 /test
parent65c7033cbe75825c4cc948b71aba9a6d7a14540d (diff)
downloadrneovim-0a5a0efda64ccc789cda25b90fa907f277006cd3.tar.gz
rneovim-0a5a0efda64ccc789cda25b90fa907f277006cd3.tar.bz2
rneovim-0a5a0efda64ccc789cda25b90fa907f277006cd3.zip
feat(lua): don't complete private (_) fields after dot (.) #32690
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/command_line_completion_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/lua/command_line_completion_spec.lua b/test/functional/lua/command_line_completion_spec.lua
index f8786a45bb..ae0ab19d6b 100644
--- a/test/functional/lua/command_line_completion_spec.lua
+++ b/test/functional/lua/command_line_completion_spec.lua
@@ -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(
{ {