Skip to content

Commit 81607f4

Browse files
committed
Fix backwards compatability with Lua.workspace.checkThirdParty
I attempted to maintain backwards compatability in #2354 and #2406 but didn't fully understand the config type system. This approach uses `Type.Or` and I even tested it to confirm that it works! Thanks to @pysan3 for pointing out how a default would be used for invalid types and to @sumneko for pointing out `Type.Or`.
1 parent 7f6f395 commit 81607f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/config/template.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,12 @@ local template = {
317317
['Lua.workspace.maxPreload'] = Type.Integer >> 5000,
318318
['Lua.workspace.preloadFileSize'] = Type.Integer >> 500,
319319
['Lua.workspace.library'] = Type.Array(Type.String),
320-
['Lua.workspace.checkThirdParty'] = Type.String >> 'Ask' << {
320+
['Lua.workspace.checkThirdParty'] = Type.Or(Type.String >> 'Ask' << {
321321
'Ask',
322322
'Apply',
323323
'ApplyInMemory',
324324
'Disable',
325-
},
325+
}, Type.Boolean),
326326
['Lua.workspace.userThirdParty'] = Type.Array(Type.String),
327327
['Lua.completion.enable'] = Type.Boolean >> true,
328328
['Lua.completion.callSnippet'] = Type.String >> 'Disable' << {

0 commit comments

Comments
 (0)