diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-17 21:25:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-17 21:25:29 +0800 |
commit | f76d98823d267951692377fd357c787f81529ab8 (patch) | |
tree | 3b75e5c24114fc3fa3e3229b6d398a2230acf556 /script-beta/provider | |
parent | e3eadcbe69168f0a42bcc843fcaae6bffaadffd9 (diff) | |
download | lua-language-server-f76d98823d267951692377fd357c787f81529ab8.zip |
暂存
Diffstat (limited to 'script-beta/provider')
-rw-r--r-- | script-beta/provider/diagnostic.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/script-beta/provider/diagnostic.lua b/script-beta/provider/diagnostic.lua index 55cfda48..38076aea 100644 --- a/script-beta/provider/diagnostic.lua +++ b/script-beta/provider/diagnostic.lua @@ -168,12 +168,14 @@ function m.doDiagnostic(uri, main, syntaxOnly) return end m.cache[uri] = full - if main and syntaxOnly and #syntax > (m.lastSynaxErrors[uri] or 0) then + if main + and syntaxOnly + and (syntax and #syntax or 0) > (m.lastSynaxErrors[uri] or 0) then await.sleep(2, function () return files.globalVersion end) end - m.lastSynaxErrors[uri] = #syntax + m.lastSynaxErrors[uri] = syntax and #syntax or 0 proto.notify('textDocument/publishDiagnostics', { uri = uri, |