Lua is nice but it being embedded in many different places means that there will often be environment specific context that's injected for you to interact with, but any editor tooling won't know what's injected
Not necessarily true.
LuaLS, the most popular LSP, uses LuaCATS (Lua comments and type system) annotations.
You can place annotation files (type stubs) in a directory and the LSP will pick them up.
I use this for a project of mine where I embed a Lua interpreter where I made several additional Lua modules available.
I ran into this recently with OBS scripting. I don't really like Lua, so I wanted to try making a Typescript-to-Lua toolchain specifically for OBS scripting. Well OBS injects a ton of stuff into the Lua environment, and I'd have to find a way to mock all of that in Typescript. Sadly, I don't have time for it, and I've chosen a different product than OBS because I don't really want to invest so much time learning a new language to accomplish something with free software when I can purchase something that just works for $40. My time is way more valuable, and this is the only time I've ever needed to code something in Lua. Yeah, OBS supports Python too, but I dislike Python even more than Lua.
I just needed a program to capture a portion of the screen under my mouse and stream it as a webcam device to Zoom, so I can screen cast a portion of my gigantic workstation desktop (6480x3840) to people with 1920x1080 screens, while following my mouse cursor around.
OBS was one stop along my journey to get there, as there's some Lua and Python scripts that achieve something similar, but not quite exactly what I wanted with multi-screens, so I began trying to modify the script to do what I needed it to do.
In the end I'm going with something called "SparkoCam" which achieves this easily with no hassle, but it costs $40. Since $40 is less than what an hour of my time is worth, it was kind of a no-brainer to abandon the hassles of learning Lua (a many hour detour) and fiddling with OBS Studio to get what I wanted. I have no real use for Lua outside of this, so it would be time wasted on this one project.
I felt the same way, hesitating to use a hardware RT music platform that is scripted in lua because "omg another lang", but I couldn't find an alternative. I bit the bullet and ... man it really is easy to use, forgiving and absurdly productive. You should reconsider, because learning lua is so easy, with so many resources out there for any question ... and then you know a "real" language and not just some OBS tech.
I simply don't have any reason to use Lua now. I replaced OBS with software that just works, and that saved me countless hours of hacking a new language to do something that may not even work how I need it to. $40 is money well spent, and Lua will have to wait for another project, if one ever comes up. And if OBS hadn't injected so much extra stuff I'd probably settled on a Typescript-to-Lua toolchain to do the work, because I just don't really have time for context switching to languages I'll only ever use for a single project.