diff options
author | uhziel <uhziel@gmail.com> | 2020-12-15 18:17:18 +0800 |
---|---|---|
committer | uhziel <uhziel@gmail.com> | 2020-12-15 18:17:18 +0800 |
commit | 295d45c0e8b781e056138e869c5c32e876272b9c (patch) | |
tree | aef6634f884e3482c971445ddfa5f030d5ba9323 /script/core/diagnostics | |
parent | f3ec5825e3c6a8090a020097e088f26718c316bb (diff) | |
download | lua-language-server-295d45c0e8b781e056138e869c5c32e876272b9c.zip |
指定诊断类型可以配置只分析打开的文件还是全项目,初版还需要支持vscode配置
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r-- | script/core/diagnostics/init.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/script/core/diagnostics/init.lua b/script/core/diagnostics/init.lua index 510b57ea..15884758 100644 --- a/script/core/diagnostics/init.lua +++ b/script/core/diagnostics/init.lua @@ -22,14 +22,10 @@ local function check(uri, name, results) end local level = config.config.diagnostics.severity[name] or define.DiagnosticDefaultSeverity[name] - if not files.isOpen(uri) then - if level == 'Hint' then - return - end - -- TODO - if name == 'undefined-field' then - return - end + + local neededFileStatus = define.DiagnosticDefaultNeededFileStatus[name] + if neededFileStatus == 'Opened' and not files.isOpen(uri) then + return end local severity = define.DiagnosticSeverity[level] local clock = os.clock() |