summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2022-05-16 13:04:07 +0800
committerkevinhwang91 <kevin.hwang@live.com>2022-05-16 13:06:41 +0800
commitf63ac95e2c30965f280b417647c34fd3fe7adf1d (patch)
tree1594d5b620d70168384bea656cc8c89a2affebb8
parentcbcbab98990b77339418209466ae037dbfec0eee (diff)
downloadlua-language-server-f63ac95e2c30965f280b417647c34fd3fe7adf1d.zip
fix(client): check .luarc.jsonc existed
-rw-r--r--script/client.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/script/client.lua b/script/client.lua
index d86fb4f2..2ce29803 100644
--- a/script/client.lua
+++ b/script/client.lua
@@ -1,3 +1,4 @@
+local fs = require 'bee.filesystem'
local nonil = require 'without-check-nil'
local util = require 'utility'
local lang = require 'language'
@@ -247,11 +248,11 @@ local function tryModifyRC(uri, finalChanges, create)
return false
end
local workspace = require 'workspace'
- local path = workspace.getAbsolutePath(uri, '.luarc.json')
- or workspace.getAbsolutePath(uri, '.luarc.jsonc')
+ local path = workspace.getAbsolutePath(uri, '.luarc.jsonc')
if not path then
return false
end
+ path = fs.exists(path) and path or workspace.getAbsolutePath(uri, '.luarc.json')
local buf = util.loadFile(path)
if not buf and not create then
return false