Skip to content

Recursive expansion on hover of generic type #1853

Open
@eigenbom

Description

@eigenbom

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?

Hover

Expected Behaviour

.

Actual Behaviour

In the following code:

---@class store<T>: {set:fun(self:store<T>, key:integer, value:T), get:fun(self:store<T>, key:integer):T}

local string_store ---@type store<string>

When you hover string_store the type recursively expands leading to a confusing hover hint:

local string_store: store<string>|{ set: fun(self: store<<T>>|{ set: fun(self: store<<T>>|{ set: unknown, get: fun(self: store<<T>>|{ set: fun(self: store<<T>>|{ set: unknown, get: unknown }, key: int...(too long)...):string }

Reproduction steps

.

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat/genericRelated to generic emulation feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions