Skip to content

Support tuple/fixed length array types? #1816

Closed
@eigenbom

Description

@eigenbom

It'd be nice to have tuple types or fixed length arrays available as annotations, declaring that a function expects e.g., an array of 3 numbers.

---@alias vec3 [number, number, number]
---@param a vec3
function length(a)
  return ...
end

or

---@alias vec3 number[3]

See e.g., https://www.typescriptlang.org/docs/handbook/basic-types.html#tuple

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions