summaryrefslogtreecommitdiff
path: root/script/config/loader.lua
diff options
context:
space:
mode:
authorAlexCai2019 <89138532+AlexCai2019@users.noreply.github.com>2022-05-08 01:43:28 +0800
committerGitHub <noreply@github.com>2022-05-08 01:43:28 +0800
commit0fd83c4ca9f82a02becab6c304a8a7de75098507 (patch)
treebe9790d9d4823fe728c5b36e94093fe5f42b7725 /script/config/loader.lua
parent89203efad8c9b5513e05ca4d5696107924865b10 (diff)
parent67b4c574849d1667e0ecb39c51aeed8e30b43056 (diff)
downloadlua-language-server-0fd83c4ca9f82a02becab6c304a8a7de75098507.zip
Merge branch 'sumneko:master' into master
Diffstat (limited to 'script/config/loader.lua')
-rw-r--r--script/config/loader.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/script/config/loader.lua b/script/config/loader.lua
index c53f9399..30711dde 100644
--- a/script/config/loader.lua
+++ b/script/config/loader.lua
@@ -1,10 +1,10 @@
-local json = require 'json'
local proto = require 'proto'
local lang = require 'language'
local util = require 'utility'
local workspace = require 'workspace'
local scope = require 'workspace.scope'
local inspect = require 'inspect'
+local jsonc = require 'jsonc'
local function errorMessage(msg)
proto.notify('window/showMessage', {
@@ -29,7 +29,7 @@ function m.loadRCConfig(uri, filename)
scp:set('lastRCConfig', nil)
return nil
end
- local suc, res = pcall(json.decode, buf)
+ local suc, res = pcall(jsonc.decode, buf)
if not suc then
errorMessage(lang.script('CONFIG_LOAD_ERROR', res))
return scp:get('lastRCConfig')
@@ -55,7 +55,7 @@ function m.loadLocalConfig(uri, filename)
end
local firstChar = buf:match '%S'
if firstChar == '{' then
- local suc, res = pcall(json.decode, buf)
+ local suc, res = pcall(jsonc.decode, buf)
if not suc then
errorMessage(lang.script('CONFIG_LOAD_ERROR', res))
return scp:get('lastLocalConfig')