Skip to content

Commit 6c89b0a

Browse files
committed
more special treates for meta files
1 parent 69b22d8 commit 6c89b0a

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
## 3.6.6
44
* `FIX` [#1825]
5+
* `FIX` [#1826]
56

67
[#1825]: https://github.com/sumneko/lua-language-server/issues/1825
8+
[#1826]: https://github.com/sumneko/lua-language-server/issues/1826
79

810
## 3.6.5
911
`2023-1-16`

script/vm/compiler.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,12 @@ local compilerSwitch = util.switch()
17441744
if firstSet then
17451745
local setNode = vm.compileNode(firstSet)
17461746
vm.setNode(source, setNode)
1747+
if vm.isMetaFile(luri) then
1748+
for i = 2, #link.sets do
1749+
setNode = vm.compileNode(link.sets[i])
1750+
vm.setNode(source, setNode)
1751+
end
1752+
end
17471753
end
17481754
end
17491755
end

test/crossfile/infer.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,26 @@ end
110110
},
111111
infer = 'V',
112112
}
113+
114+
TEST {
115+
{ path = 'a.lua', content = [[
116+
X = 1
117+
X = true
118+
]], },
119+
{ path = 'b.lua', content = [[
120+
print(<?X?>)
121+
]], },
122+
infer = 'integer',
123+
}
124+
125+
TEST {
126+
{ path = 'a.lua', content = [[
127+
---@meta
128+
X = 1
129+
X = true
130+
]], },
131+
{ path = 'b.lua', content = [[
132+
print(<?X?>)
133+
]], },
134+
infer = 'boolean|integer',
135+
}

0 commit comments

Comments
 (0)