diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-03 00:04:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-03 00:04:40 +0800 |
commit | d8b0166678abc66c6f66b78fb2ed9b87c682beee (patch) | |
tree | e03fcaa4eeea514f6fb512348fa8764908742f66 /script-beta/core | |
parent | 583fc679efcb6462e52978b4d7cbfe8d67f2e2de (diff) | |
download | lua-language-server-d8b0166678abc66c6f66b78fb2ed9b87c682beee.zip |
只有打开的文件需要进行 Hint 等级的诊断
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/diagnostics/init.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script-beta/core/diagnostics/init.lua b/script-beta/core/diagnostics/init.lua index b00e64ed..bd51ce51 100644 --- a/script-beta/core/diagnostics/init.lua +++ b/script-beta/core/diagnostics/init.lua @@ -41,11 +41,17 @@ return function (uri, response) return nil end + local isOpen = files.isOpen(uri) + for _, name in ipairs(diagList) do local level = define.DiagnosticDefaultSeverity[name] + if not isOpen and level == 'Hint' then + goto CONTINUE + end await.delay() local results = {} check(uri, name, level, results) response(results) + ::CONTINUE:: end end |