diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-14 20:13:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-14 20:13:00 +0800 |
commit | ede808fe32a66ac828762818bf43d18fc343c159 (patch) | |
tree | a4cc8808fff798ea3bfd7103fb56bfb1d74f9c9c /script/parser | |
parent | babe8e194576b0cd2ede04d98417a5f0e2a23647 (diff) | |
download | lua-language-server-ede808fe32a66ac828762818bf43d18fc343c159.zip |
stash
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 2369e84f..46c32f3a 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -293,10 +293,19 @@ end ---@param obj parser.guide.object ---@return parser.guide.object function m.getRoot(obj) + local source = obj + if source._root then + return source._root + end for _ = 1, 1000 do if obj.type == 'main' then + source._root = obj return obj end + if obj._root then + source._root = obj._root + return source._root + end local parent = obj.parent if not parent then return nil |