Skip to content

can not complete param for "overload" functions #3206

Open
@ZSaberLv0

Description

@ZSaberLv0

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Completion

Expected Behaviour

complete param for all overload functions

Actual Behaviour

can only complete params whose param count exactly matches

Reproduction steps

  1. create a lib.lua

    ---@meta test_lib
    
    ---@param p0 string|'aa'|'bb'
    function test(p0) end
    ---@param p0 string|'cc'|'dd'
    ---@param p1 number
    function test(p0, p1) end
    
  2. create a test.lua (| is the cursor position)

    test(|)
    
  3. input ' (single quote) to complete, and only the first function's p0 can be completed

    Image

  4. if the input is test(|, 0), then the second function's p0 can be completed

    Image

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