diff options
| author | Maria José Solano <majosolano99@gmail.com> | 2025-03-02 13:44:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-02 13:44:13 -0800 |
| commit | 0a5a0efda64ccc789cda25b90fa907f277006cd3 (patch) | |
| tree | cfd6082ae005ccb1debf68483be9de450796fcf1 /test | |
| parent | 65c7033cbe75825c4cc948b71aba9a6d7a14540d (diff) | |
| download | rneovim-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.lua | 24 |
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( { { |