LuaLS / LuaLS/lua-language-server
Wrong colorizing with generic pattern and long string annotations
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Other
Expected Behaviour
Correct colorizing of generic pattern modifiers (optional, union, array) #3031
---@generic T
---@param a T[]?Comment
---@return T[]?
local function new(a) end
local obj = new({"Vehicle"})
---@generic T
---@param a T|integer? # the type
---@return T|integer?
local function new(a) end
local obj = new("Vehicle")
---@generic TC
---@param a `TC`[]?Comment
---@return TC[]?
local function new(a) end
local obj = new({"Vehicle"})
---@generic TC
---@param a `TC`|integer? # the type
---@return TC|integer?
local function new(a) end
local obj = new("Vehicle")
and long string annotations modifiers #3028
--[[@param a string[] ]]
local function new(a) end
--[===[@param a string[]]===]
local function new(a) end
Actual Behaviour
"string" color after code token
"comment" color of modifiers
Reproduction steps
- Copy the code from 'Expected Behaviour'
- See the colorizing in the VS Code
Additional Notes
No response
Log File
No response
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
Reproduce the reported colors in the Visual Studio Code Lua extension using the generic-pattern and long-string annotation snippets in the issue. Start by tracing the annotation colorizing behavior, then verify that generic modifiers and long-string annotation modifiers receive the intended colors without changing ordinary code-token coloring.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100