-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I assume you are talking about the What you actually want might be create a meta definition file and then define your globals with values there 🤔
---@meta
MyGlobalVar = 123 This pattern is used by LuaLS's repo as well: https://github.com/LuaLS/lua-language-server/blob/master/script/global.d.lua |
Beta Was this translation helpful? Give feedback.
I assume you are talking about the
diagnostics.globals
settings: https://luals.github.io/wiki/settings/#diagnosticsglobalsAFAIK, this is actually NOT the best practice because the server cannot infer type from it, it is only used to mute relevant undefined global warnings.
What you actually want might be create a meta definition file and then define your globals with values there 🤔
https://luals.github.io/wiki/definition-files/
This pattern is used by LuaLS's repo as well: https://github.com/LuaLS/lua-language-server/blob/master/script/global.d.lua