summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-06-27 14:25:01 +0800
committerGitHub <noreply@github.com>2024-06-27 14:25:01 +0800
commit3886d2ede3345296fbadc96c09d42cca96affa77 (patch)
tree57e58dc1e8ca679ed921c1d67e6c92967e192b79
parentb313323384b26953a2da6f17d6f61ce1ba9b1b47 (diff)
parent6507b8a10a363da9dcf36f58ca7bcffab29568f5 (diff)
downloadlua-language-server-3886d2ede3345296fbadc96c09d42cca96affa77.zip
Merge pull request #2731 from tomlau10/bugfix/cli_default_severity
fix: default severity in CLI with partial 'diagnostics.severity' config
-rw-r--r--changelog.md1
-rw-r--r--script/cli/check_worker.lua2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index fa368c71..ef4a4017 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,7 @@
## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* `NEW` Add postfix snippet for `unpack`
+* `FIX` `diagnostics.severity` defaulting to "Warning" when run using `--check` [#2730](https://github.com/LuaLS/lua-language-server/issues/2730)
* `NEW` Add support for lambda style functions, `|paramList| expr` is syntactic sugar for `function(paramList) return expr end`
## 3.9.3
diff --git a/script/cli/check_worker.lua b/script/cli/check_worker.lua
index 0a121344..23c34b2c 100644
--- a/script/cli/check_worker.lua
+++ b/script/cli/check_worker.lua
@@ -83,7 +83,7 @@ xpcall(lclient.start, errorhandler, lclient, function (client)
local disables = util.arrayToHash(config.get(rootUri, 'Lua.diagnostics.disable'))
for name, serverity in pairs(define.DiagnosticDefaultSeverity) do
- serverity = config.get(rootUri, 'Lua.diagnostics.severity')[name] or 'Warning'
+ serverity = config.get(rootUri, 'Lua.diagnostics.severity')[name] or serverity
if serverity:sub(-1) == '!' then
serverity = serverity:sub(1, -2)
end