@@ -21,9 +21,7 @@ lclient():start(function (languageClient)
2121
2222 ---- ---------------------------
2323
24- util .saveFile (configPath , jsonb .beautify {
25- [' xxxx' ] = 1 , -- TODO: bug of json-edit, can not be an empty json
26- })
24+ util .saveFile (configPath , jsonb .beautify (json .createEmptyObject ()))
2725
2826 provider .updateConfig ()
2927
@@ -36,15 +34,12 @@ lclient():start(function (languageClient)
3634 })
3735
3836 assert (util .equal (jsonc .decode_jsonc (util .loadFile (configPath )), {
39- [' xxxx' ] = 1 ,
4037 [' Lua.runtime.version' ] = ' LuaJIT' ,
4138 }))
4239
4340 ---- ---------------------------
4441
45- util .saveFile (configPath , jsonb .beautify {
46- [' xxxx' ] = 1 , -- TODO: bug of json-edit, can not be an empty json
47- })
42+ util .saveFile (configPath , jsonb .beautify (json .createEmptyObject ()))
4843
4944 provider .updateConfig ()
5045
@@ -57,7 +52,6 @@ lclient():start(function (languageClient)
5752 })
5853
5954 assert (util .equal (jsonc .decode_jsonc (util .loadFile (configPath )), {
60- [' xxxx' ] = 1 ,
6155 [' Lua.diagnostics.disable' ] = {
6256 ' undefined-global' ,
6357 }
@@ -112,9 +106,7 @@ lclient():start(function (languageClient)
112106
113107 ---- ---------------------------
114108
115- util .saveFile (configPath , jsonb .beautify {
116- [' xxxx' ] = 1 , -- TODO: bug of json-edit, can not be an empty json
117- })
109+ util .saveFile (configPath , jsonb .beautify (json .createEmptyObject ()))
118110
119111 provider .updateConfig ()
120112
@@ -128,7 +120,6 @@ lclient():start(function (languageClient)
128120 })
129121
130122 assert (util .equal (jsonc .decode_jsonc (util .loadFile (configPath )), {
131- [' xxxx' ] = 1 ,
132123 [' Lua.runtime.special' ] = {
133124 [' include' ] = ' require' ,
134125 }
@@ -151,12 +142,11 @@ lclient():start(function (languageClient)
151142 }
152143 })
153144
154- -- TODO: bug of json-edit, can not be an empty json
155- -- assert(util.equal(jsonc.decode_jsonc(util.loadFile(configPath)), {
156- -- ['Lua.runtime.special'] = {
157- -- ['include'] = 'require',
158- -- }
159- -- }))
145+ assert (util .equal (jsonc .decode_jsonc (util .loadFile (configPath )), {
146+ [' Lua.runtime.special' ] = {
147+ [' include' ] = ' require' ,
148+ }
149+ }))
160150
161151 ---- ---------------------------
162152
0 commit comments