diff options
author | kevinhwang91 <kevin.hwang@live.com> | 2022-05-16 13:04:07 +0800 |
---|---|---|
committer | kevinhwang91 <kevin.hwang@live.com> | 2022-05-16 13:06:41 +0800 |
commit | f63ac95e2c30965f280b417647c34fd3fe7adf1d (patch) | |
tree | 1594d5b620d70168384bea656cc8c89a2affebb8 | |
parent | cbcbab98990b77339418209466ae037dbfec0eee (diff) | |
download | lua-language-server-f63ac95e2c30965f280b417647c34fd3fe7adf1d.zip |
fix(client): check .luarc.jsonc existed
-rw-r--r-- | script/client.lua | 5 |
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 |