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

the visibility of the fields of a class is not correctly evaluated when they are defined directly in the object. #2752

Closed
NeOzay opened this issue Jul 12, 2024 · 0 comments

Comments

@NeOzay
Copy link
Contributor

NeOzay commented Jul 12, 2024

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

hides fields whose scope is not accessible during completion, and triggers a diagnostic when access is not authorized.

Actual Behaviour

the visibility of the fields of a class is not correctly evaluated when they are defined directly in the object.
harms for completion and invisible dianostic.

local class = vm.getParentClass(field)

function getParentClass(field) does not get the class when field is a parser.object of type 'tablefield'

Reproduction steps

---@class Class
local Class = {
	_privateF = 10
}
---@type Class
local instance
instance._privateF = 9

server config:

{
  "Lua.doc.privateName": [
    "_*"
  ],
}

Additional Notes

No response

Log File

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant