Skip to content
Snippets Groups Projects
Unverified Commit 0e1b109c authored by 最萌小汐's avatar 最萌小汐 Committed by GitHub
Browse files

Merge pull request #2409 from 9999years/fix-back-compat-take-2

Fix backwards compatability with `Lua.workspace.checkThirdParty` (take 2!)
parents 8e880ad5 81607f4e
No related branches found
No related tags found
No related merge requests found
...@@ -317,12 +317,12 @@ local template = { ...@@ -317,12 +317,12 @@ local template = {
['Lua.workspace.maxPreload'] = Type.Integer >> 5000, ['Lua.workspace.maxPreload'] = Type.Integer >> 5000,
['Lua.workspace.preloadFileSize'] = Type.Integer >> 500, ['Lua.workspace.preloadFileSize'] = Type.Integer >> 500,
['Lua.workspace.library'] = Type.Array(Type.String), ['Lua.workspace.library'] = Type.Array(Type.String),
['Lua.workspace.checkThirdParty'] = Type.String >> 'Ask' << { ['Lua.workspace.checkThirdParty'] = Type.Or(Type.String >> 'Ask' << {
'Ask', 'Ask',
'Apply', 'Apply',
'ApplyInMemory', 'ApplyInMemory',
'Disable', 'Disable',
}, }, Type.Boolean),
['Lua.workspace.userThirdParty'] = Type.Array(Type.String), ['Lua.workspace.userThirdParty'] = Type.Array(Type.String),
['Lua.completion.enable'] = Type.Boolean >> true, ['Lua.completion.enable'] = Type.Boolean >> true,
['Lua.completion.callSnippet'] = Type.String >> 'Disable' << { ['Lua.completion.callSnippet'] = Type.String >> 'Disable' << {
......
...@@ -610,13 +610,9 @@ local function check3rd(uri) ...@@ -610,13 +610,9 @@ local function check3rd(uri)
end end
local checkThirdParty = config.get(uri, 'Lua.workspace.checkThirdParty') local checkThirdParty = config.get(uri, 'Lua.workspace.checkThirdParty')
-- Backwards compatability: `checkThirdParty` used to be a boolean. -- Backwards compatability: `checkThirdParty` used to be a boolean.
-- Note: `checkThirdParty` is defined as a string, so if a boolean is if not checkThirdParty or checkThirdParty == 'Disable' then
-- 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 return
elseif checkThirdParty == 'true' then elseif checkThirdParty == true then
checkThirdParty = 'Ask' checkThirdParty = 'Ask'
end end
local scp = scope.getScope(uri) local scp = scope.getScope(uri)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment