Code completion for lua plugins? #1339
Replies: 2 comments
-
Came here searching for this as well |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, there hasn't been much progress on this lately. Most methods and types are defined on the Rust side, and currently, there doesn't seem to be a good way to generate type definitions from them. I don't have enough time to maintain another set of documents besides the existing documentation, as it would double my workload, leaving me constantly struggling between Rust implementation, documentation, and Lua definitions. Perhaps we can revisit the possibility of finding a better way to maintain them once the plugin system stabilizes. For now, the plugin system is still in beta, meaning the API isn't fully finalized. I'm going to close this since it duplicates #981 |
Beta Was this translation helpful? Give feedback.
-
As I understand the code is written in rust and the lua interface is automagically generated, correct?
If so, is this lua file available somewhere or could it be generated? Having this file would allow to enable code completion while writing plugins. Ex: typing
ya.
would suggest possible functions.Basically, lua LSP (Lua Language Server) operates on annotations. So it doesn't even have to be a real lua file with implementation. There could be auto-generated or maintained file with defined types using annotations. Then you just attach it to LSP as a library and the autocompletion would work. Here are some examples: https://github.com/numToStr/lemmy-help/blob/master/emmylua.md
I think it would be a great improvement for plugin creators.
Beta Was this translation helpful? Give feedback.
All reactions