diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-20 20:51:41 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-20 20:51:41 +0800 |
commit | bc6dd9b20925d21e6def32170854b27f69ca50d9 (patch) | |
tree | 067d5ec1cd8596d8433176eca7833da94bfe5298 /script | |
parent | 15774e265c4060fa7eb84c1c68bea7184b65d13f (diff) | |
download | lua-language-server-bc6dd9b20925d21e6def32170854b27f69ca50d9.zip |
use `name` first
Diffstat (limited to 'script')
-rw-r--r-- | script/library.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/script/library.lua b/script/library.lua index 5772105a..3ea9e9fa 100644 --- a/script/library.lua +++ b/script/library.lua @@ -252,7 +252,8 @@ local function loadSingle3rdConfig(libraryDir) local cfg = {} - cfg.name = libraryDir:filename():string() + cfg.path = libraryDir:filename():string() + cfg.name = cfg.name or cfg.path if fs.exists(libraryDir / 'plugin.lua') then cfg.plugin = true @@ -291,9 +292,9 @@ local function load3rdConfigInDir(dir, configs, inner) local suc, res = xpcall(loadSingle3rdConfig, log.error, libraryDir) if suc and res then if inner then - res.dirname = ('${3rd}/%s'):format(res.name) + res.dirname = ('${3rd}/%s'):format(res.path) else - res.dirname = ('%s/%s'):format(dir:string(), res.name) + res.dirname = ('%s/%s'):format(dir:string(), res.path) end configs[#configs+1] = res end |