diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-06-27 14:25:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 14:25:01 +0800 |
commit | 3886d2ede3345296fbadc96c09d42cca96affa77 (patch) | |
tree | 57e58dc1e8ca679ed921c1d67e6c92967e192b79 | |
parent | b313323384b26953a2da6f17d6f61ce1ba9b1b47 (diff) | |
parent | 6507b8a10a363da9dcf36f58ca7bcffab29568f5 (diff) | |
download | lua-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.md | 1 | ||||
-rw-r--r-- | script/cli/check_worker.lua | 2 |
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 |