diff options
author | NeOzay <colpaert.benoit@gmail.com> | 2024-07-08 16:34:32 +0200 |
---|---|---|
committer | NeOzay <colpaert.benoit@gmail.com> | 2024-07-08 16:34:32 +0200 |
commit | aa0fbf5aede66b2c3f380d44f2a031d19fd2d975 (patch) | |
tree | 20d55493564019f0ddad878ca1ba96e465c0f7b3 | |
parent | 46707395df3255808682fdac883f7d86c1ac9a78 (diff) | |
download | lua-language-server-aa0fbf5aede66b2c3f380d44f2a031d19fd2d975.zip |
fix: add a missing check for inject-field diagnostics
-rw-r--r-- | script/core/diagnostics/inject-field.lua | 3 | ||||
-rw-r--r-- | test/diagnostics/inject-field.lua | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/script/core/diagnostics/inject-field.lua b/script/core/diagnostics/inject-field.lua index 2866eef8..ec027c21 100644 --- a/script/core/diagnostics/inject-field.lua +++ b/script/core/diagnostics/inject-field.lua @@ -68,6 +68,9 @@ return function (uri, callback) if def.type == 'doc.field' then return end + if def.type == 'tablefield' then + return + end end local howToFix = '' diff --git a/test/diagnostics/inject-field.lua b/test/diagnostics/inject-field.lua index 9bb0f8fc..d5b49701 100644 --- a/test/diagnostics/inject-field.lua +++ b/test/diagnostics/inject-field.lua @@ -82,3 +82,16 @@ function m:init() -- OK end end ]] + +TEST [[ +---@class Class +local m = { + xx = 1, -- OK +} + +---@type Class +local m + +m.xx = 1 -- OK +m.<!yy!> = 1 -- Warning +]] |