summaryrefslogtreecommitdiff
path: root/script/config
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-27 22:15:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-27 22:15:37 +0800
commitf2800d17cb469ea1442fdc9d7352c6414e5d6bf1 (patch)
tree236816a6a729b8648bd43230be38fb0824075eac /script/config
parentaf9ec1db4516a0977649c0b08e4ed88078724e97 (diff)
downloadlua-language-server-f2800d17cb469ea1442fdc9d7352c6414e5d6bf1.zip
support `.luarc.jsonc`
Diffstat (limited to 'script/config')
-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')