Skip to content

Feature request: Separated suggestions on each function definition with different params #478

@astrochili

Description

@astrochili

Is it possible to generate separated suggestions on each function name with different params?
I also tried @overload but it works the same way with only one suggestion.

How definitions look:

---Creates a new zero vector with all components set to 0.
---@return vector4 new zero vector
function vmath.vector4() end

---Creates a new vector with all components set to the
---supplied scalar value.
---@param n number scalar value to splat
---@return vector4 new vector
function vmath.vector4(n) end

---Creates a new vector with all components set to the
---corresponding values from the supplied vector. I.e.
---This function creates a copy of the given vector.
---@param v1 vector4 existing vector
---@return vector4 new vector
function vmath.vector4(v1) end

---Creates a new vector with the components set to the
---supplied values.
---@param x number x coordinate
---@param y number y coordinate
---@param z number z coordinate
---@param w number w coordinate
---@return vector4 new vector
function vmath.vector4(x, y, z, w) end

How it works in VSCode with lua-language-server:
On completion it always paste the first definition that have more than zero params, vmath.vector4(n: number).
Screenshot 2021-03-29 at 11 37 02

How it works in IDEA with EmmyLua:
IMAGE 2021-03-29 11:32:36

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions