Skip to content

Commit 5741362

Browse files
committed
fix #1229
1 parent 3534367 commit 5741362

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

Diff for: changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* `FIX` diagnostics flash when opening a file
2828
* `FIX` sometimes workspace diagnostics are not triggered
2929
* `FIX` [#1228](https://github.com/sumneko/lua-language-server/issues/1228)
30+
* `FIX` [#1229](https://github.com/sumneko/lua-language-server/issues/1229)
3031

3132
## 3.3.1
3233
`2022-6-17`

Diff for: script/vm/compiler.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ local searchFieldSwitch = util.switch()
102102
end
103103
end)
104104
: case 'string'
105+
: case 'doc.type.string'
105106
: call(function (suri, source, key, ref, pushResult)
106107
-- change to `string: stringlib` ?
107108
local stringlib = vm.getGlobal('type', 'stringlib')
@@ -706,7 +707,8 @@ function vm.compileByParentNode(source, key, ref, pushResult)
706707
and node.cate == 'type'
707708
---@cast node vm.global
708709
and not guide.isBasicType(node.name)
709-
) then
710+
)
711+
or node.type == 'doc.type.string' then
710712
searchFieldSwitch(node.type, suri, node, key, ref, function (res, markDoc)
711713
if markDoc then
712714
docedResults[#docedResults+1] = res

Diff for: test/diagnostics/common.lua

+20
Original file line numberDiff line numberDiff line change
@@ -1675,3 +1675,23 @@ TEST [[
16751675
---@field [A] A
16761676
---@field [<!A!>] true
16771677
]]
1678+
1679+
TEST [[
1680+
---@diagnostic disable: unused-local
1681+
1682+
---@type 'x'
1683+
local t
1684+
1685+
local n = t:upper()
1686+
]]
1687+
1688+
TEST [[
1689+
---@diagnostic disable: unused-local
1690+
1691+
---@alias A 'x'
1692+
1693+
---@type A
1694+
local t
1695+
1696+
local n = t:upper()
1697+
]]

0 commit comments

Comments
 (0)