Skip to content

Wrong colorizing with generic pattern and long string annotations #3032

Open
@TIMONz1535

Description

@TIMONz1535

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions