Skip to content

'__close' metamethod is not recognized for 'metatable' type #2335

@ArmoredPony

Description

@ArmoredPony

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?

Completion, Diagnostics/Syntax Checking

Expected Behaviour

The following piece of code should yieid no issues:

local mt = {} ---@type metatable
mt.__close = function () end

Actual Behaviour

The language server believes that __close is not a metamethod and doesn't belong to metatable type:
image
This method also does not appear in suggestions:
image

Reproduction steps

  1. Past code from example.
  2. Observe the issue.

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions