File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## 3.6.24
4
4
* ` FIX ` shake of ` codeLens `
5
+ * ` FIX ` [ #2145 ]
6
+
7
+ [ #2145 ] : https://github.com/LuaLS/lua-language-server/issues/2145
5
8
6
9
## 3.6.23
7
10
` 2023-7-7 `
Original file line number Diff line number Diff line change @@ -7,9 +7,7 @@ local glob = require 'glob'
7
7
--- @class parser.object
8
8
--- @field package _visibleType ? parser.visibleType
9
9
10
- --- @param source parser.object
11
- --- @return parser.visibleType
12
- function vm .getVisibleType (source )
10
+ local function getVisibleType (source )
13
11
if source ._visibleType then
14
12
return source ._visibleType
15
13
end
@@ -55,6 +53,23 @@ function vm.getVisibleType(source)
55
53
return ' public'
56
54
end
57
55
56
+ --- @param source parser.object
57
+ --- @return parser.visibleType
58
+ function vm .getVisibleType (source )
59
+ if source ._visibleType then
60
+ return source ._visibleType
61
+ end
62
+ for _ , def in ipairs (vm .getDefs (source )) do
63
+ local visible = getVisibleType (def )
64
+ if visible ~= ' public' then
65
+ source ._visibleType = visible
66
+ return visible
67
+ end
68
+ end
69
+ source ._visibleType = ' public'
70
+ return ' public'
71
+ end
72
+
58
73
--- @param source parser.object
59
74
--- @return vm.global ?
60
75
function vm .getParentClass (source )
Original file line number Diff line number Diff line change @@ -2381,6 +2381,25 @@ local obj: B {
2381
2381
}
2382
2382
]]
2383
2383
2384
+ TEST [[
2385
+ ---@class A
2386
+ local M = {}
2387
+
2388
+ ---@private
2389
+ M.x = 0
2390
+
2391
+ ---@private
2392
+ function M:init()
2393
+ self.x = 1
2394
+ end
2395
+
2396
+ ---@type A
2397
+ local <?a?>
2398
+ ]]
2399
+ [[
2400
+ local a: A
2401
+ ]]
2402
+
2384
2403
TEST [[
2385
2404
---@class A
2386
2405
---@field x fun(): string
You can’t perform that action at this time.
0 commit comments