Open hfn92 opened 9 months ago
This is out of sol
's scope and requires a similar approach to binding generation.
You can however write wrappers around sol
registration functions which create a database for each registered usertype/function/variable
and populate it with proper metadata: name/type etc...
This approach is used in this project: nbind
And then use this created database to create you own annotation file.
This topic should be treated in a separate fashion IMO.
I was wondering if it's possible or reasonable for
sol2
to generate lua annotations.For example when defining a type like this:
One could generate a lua file like this:
After defining all usertypes one would call some function to generate the annotations lua file, which can be pointed to via the
workspace.library
field in the.luarc.json
This would allow your custom scripting api to have auto-completion and basic type checking when using lua-language-server for example.