-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Lua: plugins can easily get Lua annotations metadata #22287
Comments
Now we have fully populated |
Almost. I think we need a util function that makes it easy for plugins to consume the LuaLS annotations. The annotations are the "data structure" that we ship, but AFAIK it's not easy to get a Lua structure from that. So let's use this issue to track that idea.
We are still missing Ex commands I think? Also normal mode. |
Out of curiosity, what are some potential use cases for plugins to consume this type of data? |
Use-cases:
Alternatively, we could require LSP for these things. But I'm hesitant to close the door on this idea; a treesitter-based util function doesn't seem like wasted effort to avoid a permanent LSP dependency, and it could start out fairly primitive (no markdown support). |
Problem
For clients to get function signatures and type information, currently we need to model APIs in C. It's not easy for clients to generate their own language-specific interface to the Nvim Lua stdlib (
vim.*
,:help lua-stdlib
).Expected behavior
We have started to annotate the Lua stdlidb with LuaLS
EmmyLuatype hints. We could use this togenerate something likeOr alternatively, just ship a:help api-metadata
and expose it as a secondary tree vianvim_get_api_info()
andnvim --api
.luameta.lua
orluameta.mpack
file in the runtime files, which can be loaded by clients to generate their wrappers.foo.mpack
files (currently undocumented but they live inruntime/doc/*.mpack
)runtime/lua/vim/_meta
for quasi-introsopection. #19918libnvim
.:help api-contract
, since this would mean that RPC clients now depend on the Lua stdlib. Thus it would be harder to evolve the Lua stdlib.The text was updated successfully, but these errors were encountered: