-
-
Notifications
You must be signed in to change notification settings - Fork 384
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?
Annotations, Completion
Expected Behaviour
Class parameters declared with ---@Private don't show up in the intellisense auto-complete.
Actual Behaviour
Class parameters if declared anywhere without the use of the ---@private
annotation show up in the intellisense auto-complete. They still give the correct error message when you try to use them Field `private_variable` is private, it can only be accessed in class `TestClass`.
, but it would be preferable if they didn't show up at all.
Setting the parameter ---@private
anywhere that it is declared solves the issue, but is not optimal 😞
The issue only shows up for non-table values. Tables correctly don't show up in the auto-complete.
Reproduction steps
Copyable code from screenshots that displays this issue:
TestClass = TestClass or {}
---@private
TestClass.private_variable = 1
---@private
function TestClass.private_function()
TestClass.private_variable = 1
end
function TestClass.public_function() end
TestClass2 = TestClass
TestClass2
Additional Notes
No response
Log File
No response