summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-11-08 10:16:55 +0800
committerGitHub <noreply@github.com>2023-11-08 10:16:55 +0800
commit8e880ad5eee0178e32819819eef315d462f4ae65 (patch)
treed6c12e2448be914962fbcb0351d92d94c56a1149
parent5a763b0ceecc9a817c8ce534dc726f5f6f6e1ac9 (diff)
parent13a24eef2329cdc19008421666af51e50d6c0889 (diff)
downloadlua-language-server-8e880ad5eee0178e32819819eef315d462f4ae65.zip
Merge pull request #2406 from 9999years/checkthirdparty-back-compat
Fix backwards compatability with `Lua.workspace.checkThirdParty`
-rw-r--r--script/library.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/script/library.lua b/script/library.lua
index 4446797a..290b5b33 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -610,9 +610,13 @@ local function check3rd(uri)
end
local checkThirdParty = config.get(uri, 'Lua.workspace.checkThirdParty')
-- Backwards compatability: `checkThirdParty` used to be a boolean.
- if not checkThirdParty or checkThirdParty == 'Disable' then
+ -- Note: `checkThirdParty` is defined as a string, so if a boolean is
+ -- supplied, it's converted to a string by the `config.config` module.
+ -- Hence we check for the strings `'true'` and `'false`' here, rather than
+ -- the boolean literals.
+ if checkThirdParty == 'Disable' or checkThirdParty == 'false' then
return
- elseif checkThirdParty == true then
+ elseif checkThirdParty == 'true' then
checkThirdParty = 'Ask'
end
local scp = scope.getScope(uri)