You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Priority for function definitions in external files over local script #3106
Description:
When a function is defined both in an external file (e.g., qlua.d.lua) and in the local script, Lua Language Server prioritizes the local definition. This behavior makes it difficult to use external annotations and documentation for functions that are implemented locally.
Steps to reproduce:
Define a function in qlua.d.lua with annotations:
lua
Copy
---@PARAM index number
---@return number|nil
function OnCalculate(index) end
Define the same function in the local script without annotations:
lua
Copy
function OnCalculate(index)
-- Implementation
end
Hover over the function in the local script.
Expected behavior:
Lua Language Server should prioritize the definition from qlua.d.lua for tooltips and documentation.
Actual behavior:
Lua Language Server uses the local definition, ignoring the one from qlua.d.lua.
Proposed solution:
Add an option to prioritize definitions from external files over local ones. For example, a setting like:
I would like this a lot. I feel like it's a bunch of noise to have annotations directly above the things they annotate throughout the entire codebase and would much rather have something that gets out of the way that the language server could still give me details from when I want them.
Activity
AbbyRead commentedon Aug 31, 2026
I would like this a lot. I feel like it's a bunch of noise to have annotations directly above the things they annotate throughout the entire codebase and would much rather have something that gets out of the way that the language server could still give me details from when I want them.