Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid autocomplete in class functions body #1824

Closed
AFCMS opened this issue Jan 15, 2023 · 0 comments
Closed

Invalid autocomplete in class functions body #1824

AFCMS opened this issue Jan 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@AFCMS
Copy link

AFCMS commented Jan 15, 2023

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Completion

Expected Behaviour

Creating a table class including functions should not autocomplete other table fields inside them, but the actual local/globals values.

Actual Behaviour

Capture d’écran du 2023-01-14 09-49-33

Its strange, because it works sometimes.

Capture d’écran du 2023-01-14 09-51-04

Reproduction steps

---@class test_class
---@field test_field fun(s: string): integer
---@field test_field_2 fun(s: integer): string

---@param d test_class
function test_function(d)
    -- Do stuff
end

test_function({
    test_field = function(s)
        -- check it never autocomplete test_field_2 instead of the global/locals
    end,
})

Additional Notes

None

Log File

None

@sumneko sumneko added the bug Something isn't working label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants