Closed
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?
Annotations
Expected Behaviour
feature #2484
Generic pattern can't recognize non-letter characters after `T` for example `T`.Base or `T`*
There is my example
---@generic T
---@param t MainContainer.`T`
---@return T
local function SubContainerClass(t) end
local mainContainerBase = SubContainerClass('Base') -- MainContainer.Base
local mainContainerSubExtra = SubContainerClass('SubExtra') -- MainContainer.SubExtra
---@generic T
---@param t `T`.Base
---@return T
local function ContainerClassBase(t) end
local mainContainerBase = ContainerClassBase('MainContainer') -- BUG: MainContainer instead of MainContainer.Base
local extraContainerBase = ContainerClassBase('ExtraContainer') -- BUG: ExtraContainer instead of ExtraContainer.Base
---@generic T
---@param t `T`*
---@return T
local function GetObjectPointer(t) end
---@generic T
---@param t `T`2
---@return T
local function GetObject2(t) end
local entityPointer = GetObjectPointer('Entity') -- BUG: Entity instead of Entity*
local entity2 = GetObject2('Entity') -- BUG: Entity instead of Entity2
Actual Behaviour
---@generic T
---@param t1 A.`T`Base -- works
---@param t2 A`T`Base -- works
---@param t3 A*`T` -- works
---@param t4 A`T`.Base -- nothing after `T`
---@param t5 `T`.Base -- nothing after `T`
---@param t6 `T`Base -- nothing after `T`
---@param t7 A*`T`* -- nothing after `T`
---@param t8 `T`* -- nothing after `T`
---@param t9 A`T`2 -- seems to be broken at all
---@return T
local function Test(t1,t2,t3,t4,t5,t6,t7,t8,t9) end
Reproduction steps
- Create generic patter with
*
,.
or number after `T` - There is no more definition after `T`
Additional Notes
Your class name can be very weird, but it works.
I just want to use pointer Class*
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels