lua-language-server
lua-language-server copied to clipboard
Fringe Use Case: Different environments in different parts of the file
This may seem like a ridiculous idea, and it is, but a project I am working with called Recoil Engine has a concept called "gadgets", which run in different contexts ("synced" or "unsynced") which provide different environments based on when the gadget is executed. This is a weird way of doing it, sure, but it's a 20 year old codebase.
My question is if it would be possible to provide LS support for these different contexts by offering some kind of annotation like --- @context synced via a plugin to change what is available in different parts of the file.
Relatedly, would it be possible to offer different environments based on filepaths? for example, Recoil's UI stuff would be exposed in /luaui but not /luarules.
Is it also possible to mark a function as being "virtual"?