Closed
Description
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.
lua-language-server/script/vm/visible.lua
Line 164 in ddc96bd
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
Metadata
Metadata
Assignees
Labels
No labels