summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r--script/core/diagnostics/init.lua12
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()