From 13a24eef2329cdc19008421666af51e50d6c0889 Mon Sep 17 00:00:00 2001 From: Rebecca Turner <rbt@sent.as> Date: Tue, 7 Nov 2023 09:14:19 -0800 Subject: [PATCH] Fix backwards compatability with `Lua.workspace.checkThirdParty` I attempted to maintain backwards compatability in #2354 but didn't fully understand the config type system. --- script/library.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/library.lua b/script/library.lua index 4446797a7..290b5b335 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) -- GitLab