summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
authoruhziel <uhziel@gmail.com>2020-12-07 15:07:57 +0800
committeruhziel <uhziel@gmail.com>2020-12-07 15:07:57 +0800
commit96b3b67e5153a012a3461e00c5e1a7667d116ad6 (patch)
tree21db7a455dfae1de189d6722946aa7f52f790499 /script/provider
parent50b9a199e5f4bc2bf2143f5d1b8747bac82d8272 (diff)
downloadlua-language-server-96b3b67e5153a012a3461e00c5e1a7667d116ad6.zip
可以通过选项 diagnostics.disable 来禁用语法错误
改后,PROBLEMS 中出现的问题均可禁用
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/diagnostic.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 8614ef78..b155a591 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -141,7 +141,9 @@ function m.syntaxErrors(uri, ast)
local results = {}
for _, err in ipairs(ast.errs) do
- results[#results+1] = buildSyntaxError(uri, err)
+ if not config.config.diagnostics.disable[err.type:lower():gsub('_', '-')] then
+ results[#results+1] = buildSyntaxError(uri, err)
+ end
end
return results