diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-12-01 20:15:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-12-01 20:15:03 +0800 |
commit | 6f3c3d8773ade57913b4121bebccf9ce73f748a8 (patch) | |
tree | bc1e8a567a8962d2ba4483d60b4f0100c6ecd41c /test/tclient/tests | |
parent | 671f1f4562ff284530c4be5a4296bf8ddb42b90a (diff) | |
download | lua-language-server-6f3c3d8773ade57913b4121bebccf9ce73f748a8.zip |
add workaround for editting empty object
Diffstat (limited to 'test/tclient/tests')
-rw-r--r-- | test/tclient/tests/modify-luarc.lua | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/test/tclient/tests/modify-luarc.lua b/test/tclient/tests/modify-luarc.lua index 14c9fc65..94756847 100644 --- a/test/tclient/tests/modify-luarc.lua +++ b/test/tclient/tests/modify-luarc.lua @@ -21,9 +21,7 @@ lclient():start(function (languageClient) ------------------------------- - util.saveFile(configPath, jsonb.beautify { - ['xxxx'] = 1, -- TODO: bug of json-edit, can not be an empty json - }) + util.saveFile(configPath, jsonb.beautify(json.createEmptyObject())) provider.updateConfig() @@ -36,15 +34,12 @@ lclient():start(function (languageClient) }) assert(util.equal(jsonc.decode_jsonc(util.loadFile(configPath)), { - ['xxxx'] = 1, ['Lua.runtime.version'] = 'LuaJIT', })) ------------------------------- - util.saveFile(configPath, jsonb.beautify { - ['xxxx'] = 1, -- TODO: bug of json-edit, can not be an empty json - }) + util.saveFile(configPath, jsonb.beautify(json.createEmptyObject())) provider.updateConfig() @@ -57,7 +52,6 @@ lclient():start(function (languageClient) }) assert(util.equal(jsonc.decode_jsonc(util.loadFile(configPath)), { - ['xxxx'] = 1, ['Lua.diagnostics.disable'] = { 'undefined-global', } @@ -112,9 +106,7 @@ lclient():start(function (languageClient) ------------------------------- - util.saveFile(configPath, jsonb.beautify { - ['xxxx'] = 1, -- TODO: bug of json-edit, can not be an empty json - }) + util.saveFile(configPath, jsonb.beautify(json.createEmptyObject())) provider.updateConfig() @@ -128,7 +120,6 @@ lclient():start(function (languageClient) }) assert(util.equal(jsonc.decode_jsonc(util.loadFile(configPath)), { - ['xxxx'] = 1, ['Lua.runtime.special'] = { ['include'] = 'require', } @@ -151,12 +142,11 @@ lclient():start(function (languageClient) } }) - -- TODO: bug of json-edit, can not be an empty json - -- assert(util.equal(jsonc.decode_jsonc(util.loadFile(configPath)), { - -- ['Lua.runtime.special'] = { - -- ['include'] = 'require', - -- } - -- })) + assert(util.equal(jsonc.decode_jsonc(util.loadFile(configPath)), { + ['Lua.runtime.special'] = { + ['include'] = 'require', + } + })) ------------------------------- |