xxxg0001 / lua-for-vscode

lua-for-vscode
MIT License
18 stars 5 forks source link

Adding autocomplete for custom classes when using Lua as embedded scripting language #9

Open tanis2000 opened 7 years ago

tanis2000 commented 7 years ago

Hi! Is there a guideline to add autocomplete support for custom functions exported by own software that uses Lua as a scripting language?

As an example I have my own C++ game engine and I'm using Lua as a scripting language and I would luke to add my own exported C++ functions to autocomplete.

Cheers!

lgcagithub commented 7 years ago

The plugin haven't supported this feature yet, but your advice is a good idea and we will make attempts to implement it .

xxxg0001 commented 7 years ago

The original intention of this plugin is to solve "go to definiton", maybe we can load a CFunctions config when find Cfunction definition.

tanis2000 commented 7 years ago

I don't know much about how VSCode handles language definitions, but it would be awesome if I could just dump from Lua the content of the global table so that I have a list of all the modules and functions and convert it to whatever format is needed by VSCode language definition (JSON?).

I guess I'd have to also find a way to dump the correct signature of functions (the list of parameters and return values) but I could as well do that manually every time I change something in the underlying C++ classes.

Is this something that could be achieved?

xxxg0001 commented 7 years ago

I think that can be achieved, but I often work overtime recently, I will try when i am free