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 22
33## 3.6.24
44* ` FIX ` shake of ` codeLens `
5+ * ` FIX ` [ #2145 ]
6+
7+ [ #2145 ] : https://github.com/LuaLS/lua-language-server/issues/2145
58
69## 3.6.23
710` 2023-7-7 `
Original file line number Diff line number Diff line change @@ -7,9 +7,7 @@ local glob = require 'glob'
77--- @class parser.object
88--- @field package _visibleType ? parser.visibleType
99
10- --- @param source parser.object
11- --- @return parser.visibleType
12- function vm .getVisibleType (source )
10+ local function getVisibleType (source )
1311 if source ._visibleType then
1412 return source ._visibleType
1513 end
@@ -55,6 +53,23 @@ function vm.getVisibleType(source)
5553 return ' public'
5654end
5755
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+
5873--- @param source parser.object
5974--- @return vm.global ?
6075function vm .getParentClass (source )
Original file line number Diff line number Diff line change @@ -2381,6 +2381,25 @@ local obj: B {
23812381}
23822382]]
23832383
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+
23842403TEST [[
23852404---@class A
23862405---@field x fun(): string
You can’t perform that action at this time.
0 commit comments