Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimscript introspection / meta structure #19918

Open
justinmk opened this issue Aug 24, 2022 · 0 comments
Open

vimscript introspection / meta structure #19918

justinmk opened this issue Aug 24, 2022 · 0 comments
Labels

Comments

@justinmk
Copy link
Member

justinmk commented Aug 24, 2022

Problem

Where should "core introspection" stuff live? Currently we have introspection interfaces in these places:

  1. context.c
  2. nvim_get_api,
  3. nvim_get_commands, nvim_get_functions
  4. src/nvim/eval.lua (internal)

Proposal

  1. context.c (nvim_get_context) is for mutable state that can be saved and restored.
    • variables, regs, jumps, bufs, gvars, …
  2. nvim_get_api is for C/RPC API only.
  3. ✅ user-defined Vimscript functions/commands are introspectable via:
  4. runtime/…/_meta/*.lua provides docstring annotations for internal functions.
    • _meta/options.lua provides annotations for options. PR #24528
    • _meta/vimfn.lua provides annotations for builtin Vimscript functions. PR #24493
    • TODO: _meta/vimcmd.lua provides annotations for builtin Ex commands. #26903 PR #27111
    • TODO: _meta/vimnormal.lua provides annotations for builtin Normal commands. #8029 #18750

TODO

  • Document the above.
  • Document runtime/doc/api.mpack and related runtime/doc/*.mpack files that we already ship!
  • Provide a util function that makes it easy for plugins to get a Lua structure from docstring annotations.
    • This allows "which-key" and fuzzy-finder plugins to easily present the info from _meta/vimfn.lua.
@justinmk justinmk added enhancement feature request api libnvim, Nvim RPC API needs:discussion For PRs that propose significant changes to some part of the architecture or API lua stdlib needs:decision A discussion has run its course and a decision has to be made how to proceed architecture and removed enhancement feature request labels Aug 24, 2022
@justinmk justinmk changed the title How should "introspection" functions be exposed? How should "introspection" be exposed? Aug 2, 2023
@justinmk justinmk removed needs:decision A discussion has run its course and a decision has to be made how to proceed needs:discussion For PRs that propose significant changes to some part of the architecture or API labels Aug 4, 2023
@justinmk justinmk changed the title How should "introspection" be exposed? Vimscript introspection Jan 23, 2024
@justinmk justinmk changed the title Vimscript introspection vimscript introspection Jan 23, 2024
@justinmk justinmk added vimscript enhancement feature request labels Jan 23, 2024
@justinmk justinmk changed the title vimscript introspection vimscript introspection / meta Jan 23, 2024
@justinmk justinmk changed the title vimscript introspection / meta vimscript introspection / meta structure Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant