diff options
author | Rebecca Turner <rbt@sent.as> | 2023-11-08 18:33:10 -0800 |
---|---|---|
committer | Rebecca Turner <rbt@sent.as> | 2023-11-08 18:33:10 -0800 |
commit | 81607f4e63c7b513f52a19eb6e399b87354463e9 (patch) | |
tree | 548112ee41b9fdd262d86cbe4d5caa985380d58f | |
parent | 7f6f395e6c3faf3d164930994f7f571df703255b (diff) | |
download | lua-language-server-81607f4e63c7b513f52a19eb6e399b87354463e9.zip |
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`.
-rw-r--r-- | script/config/template.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/config/template.lua b/script/config/template.lua index 6919efa8..ba0fd503 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -317,12 +317,12 @@ local template = { ['Lua.workspace.maxPreload'] = Type.Integer >> 5000, ['Lua.workspace.preloadFileSize'] = Type.Integer >> 500, ['Lua.workspace.library'] = Type.Array(Type.String), - ['Lua.workspace.checkThirdParty'] = Type.String >> 'Ask' << { + ['Lua.workspace.checkThirdParty'] = Type.Or(Type.String >> 'Ask' << { 'Ask', 'Apply', 'ApplyInMemory', 'Disable', - }, + }, Type.Boolean), ['Lua.workspace.userThirdParty'] = Type.Array(Type.String), ['Lua.completion.enable'] = Type.Boolean >> true, ['Lua.completion.callSnippet'] = Type.String >> 'Disable' << { |