aboutsummaryrefslogtreecommitdiff
path: root/scripts/util.lua
diff options
context:
space:
mode:
authorJongwook Choi <wookayin@gmail.com>2024-10-04 09:48:31 -0400
committerGitHub <noreply@github.com>2024-10-04 06:48:31 -0700
commitd5ae5c84e94a2b15374ee0c7e2f4444c161a8a63 (patch)
treec37bd8000fe2e27199c2263fc9d9c0357d3f2067 /scripts/util.lua
parent86c5c8724bd85154c4e94474d1d9a0b01e296028 (diff)
downloadrneovim-d5ae5c84e94a2b15374ee0c7e2f4444c161a8a63.tar.gz
rneovim-d5ae5c84e94a2b15374ee0c7e2f4444c161a8a63.tar.bz2
rneovim-d5ae5c84e94a2b15374ee0c7e2f4444c161a8a63.zip
feat(lua): completion for vim.fn, vim.v, vim.o #30472
Problem: Lua accessors for - global, local, and special variables (`vim.{g,t,w,b,v}.*`), and - options (`vim.{o,bo,wo,opt,opt_local,opt_global}.*`), do not have command-line completion, unlike their vimscript counterparts (e.g., `g:`, `b:`, `:set`, `:setlocal`, `:call <fn>`, etc.). Completion for vimscript functions (`vim.fn.*`) is incomplete and does not list all the available functions. Solution: Implement completion for vimscript function, variable and option accessors in `vim._expand_pat` through: - `getcompletion()` for variable and vimscript function accessors, and - `nvim_get_all_options_info()` for option accessors. Note/Remark: - Short names for options are yet to be implemented. - Completions for accessors with handles (e.g. `vim.b[0]`, `vim.wo[0]`) are also yet to be implemented, and are left as future work, which involves some refactoring of options. - For performance reasons, we may want to introduce caching for completing options, but this is not considered at this time since the number of the available options is not very big (only ~350) and Lua completion for option accessors appears to be pretty fast. - Can we have a more "general" framework for customizing completions? In the future, we may want to improve the implementation by moving the core logic for generating completion candidates to each accessor (or its metatable) or through some central interface, rather than writing all the accessor-specific completion implementations in a single function: `vim._expand_pat`.
Diffstat (limited to 'scripts/util.lua')
0 files changed, 0 insertions, 0 deletions