diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-22 20:42:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-22 20:42:16 +0800 |
commit | e9ef67eb9f999aa51ac793cd70252e5587eb3bd6 (patch) | |
tree | 500a08121f1dc3975be11c04787733510e13c7a6 /script/client.lua | |
parent | 22cfc98fa8684002e6ab8a8279e898862ba0f494 (diff) | |
download | lua-language-server-e9ef67eb9f999aa51ac793cd70252e5587eb3bd6.zip |
add `$schema`
Diffstat (limited to 'script/client.lua')
-rw-r--r-- | script/client.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/script/client.lua b/script/client.lua index 0409b742..d9ec0c16 100644 --- a/script/client.lua +++ b/script/client.lua @@ -207,7 +207,7 @@ end local function tryModifyRC(finalChanges, create) if #finalChanges == 0 then - return + return false end local workspace = require 'workspace' local loader = require 'config.loader' @@ -219,7 +219,9 @@ local function tryModifyRC(finalChanges, create) if not buf and not create then return false end - local rc = loader.lastRCConfig or {} + local rc = loader.lastRCConfig or { + ['$schema'] = lang.id == 'zh-cn' and [[https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema-zh-cn.json]] or [[https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json]] + } applyConfig(rc, finalChanges) util.saveFile(path, json.beautify(rc, { indent = ' ' })) return true @@ -227,7 +229,7 @@ end local function tryModifyClient(finalChanges) if #finalChanges == 0 then - return + return false end if not m.getOption 'changeConfiguration' then return false |