LuaLS / LuaLS/lua-language-server
`@deprecated` is ignored on globals when assigned by another global
Open
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
meta.lua
---@meta
--
--Assigning a global fails.
--
Global = {}
---@deprecated
AssignedGlobal = Global
--
--Assigning a field of a global also fails.
--
Global.field = {}
---@deprecated
AssignedGlobalField = Global.field
--
--Standard object works.
--
---@deprecated
Object = {}
--
--Assignment of local object works.
--
local alsoWorking = {}
---@deprecated
AssignedLocalObject = alsoWorking
test.lua
local x = AssignedGlobal
local y = AssignedGlobalField
local z = Object
local a = AssignedLocalObject
Interestingly the deprecation is shown correctly in the autocomplete:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducer in meta.lua and test.lua, then run it through the language server to compare deprecation handling for global, field, standard-object, and local assignments. Done means AssignedGlobal and AssignedGlobalField are marked deprecated like Object and AssignedLocalObject, with autocomplete behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100