LuaLS / LuaLS/lua-language-server

Wrong colorizing with generic pattern and long string annotations

Open
#3,032 0 comments 0 reactions 0 assignees View on GitHub

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

{54A2ED2A-62EC-44C1-A93B-D793EC085E01}

Reproduction steps
  1. Copy the code from 'Expected Behaviour'
  2. See the colorizing in the VS Code
Additional Notes

No response

Log File

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.