Skip to content

Commit b175fd2

Browse files
committed
fix
1 parent 8850130 commit b175fd2

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

script/core/diagnostics/assign-type-mismatch.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ return function (uri, callback)
7676
return
7777
end
7878
if source.type == 'setfield'
79-
or source.type == 'setindex' then
79+
or source.type == 'setindex'
80+
or source.type == 'tableexp' then
8081
return
8182
end
8283
end

script/provider/provider.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local scope = require 'workspace.scope'
1919
local furi = require 'file-uri'
2020
local inspect = require 'inspect'
2121
local guide = require 'parser.guide'
22-
local fs = require 'bee.filesystem'
22+
local fs = require 'bee.filesystem'
2323

2424
require 'library'
2525

@@ -1152,8 +1152,8 @@ m.register '$/status/click' {
11521152
local titleDiagnostic = lang.script.WINDOW_LUA_STATUS_DIAGNOSIS_TITLE
11531153
local result = client.awaitRequestMessage('Info', lang.script.WINDOW_LUA_STATUS_DIAGNOSIS_MSG, {
11541154
titleDiagnostic,
1155-
DEVELOP and 'Restart Server',
1156-
DEVELOP and 'Clear Node Cache',
1155+
DEVELOP and 'Restart Server' or nil,
1156+
DEVELOP and 'Clear Node Cache' or nil,
11571157
})
11581158
if not result then
11591159
return

test/diagnostics/type-check.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,11 @@ TEST [[
956956
local t = { <!1!>, <!2!>, <!3!> }
957957
]]
958958

959+
TEST [[
960+
---@type boolean[]
961+
local t = { true, false, nil }
962+
]]
963+
959964
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
960965
config.remove(nil, 'Lua.diagnostics.disable', 'unused-function')
961966
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')

0 commit comments

Comments
 (0)