diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-15 20:45:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-15 20:45:49 +0800 |
commit | f40f0a54b1b8ccb97bc30d21d16d4f212b178ada (patch) | |
tree | 6315dd1cf40615ffd040ede8e1f8957c3ace47ff /script/core/diagnostics/need-check-nil.lua | |
parent | fde5288aa33c1deadc0724cb2e9df2b628a310c6 (diff) | |
download | lua-language-server-f40f0a54b1b8ccb97bc30d21d16d4f212b178ada.zip |
`need-check-nil` check `t[x]`
Diffstat (limited to 'script/core/diagnostics/need-check-nil.lua')
-rw-r--r-- | script/core/diagnostics/need-check-nil.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/script/core/diagnostics/need-check-nil.lua b/script/core/diagnostics/need-check-nil.lua index 56cb1eae..867d0135 100644 --- a/script/core/diagnostics/need-check-nil.lua +++ b/script/core/diagnostics/need-check-nil.lua @@ -24,6 +24,10 @@ return function (uri, callback) if call and call.type == 'call' and call.node == src then checkNil = true end + local setIndex = src.parent + if setIndex and setIndex.type == 'setindex' and setIndex.index == src then + checkNil = true + end if not checkNil then return end |