summaryrefslogtreecommitdiff
path: root/script/library.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-12-30 21:57:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-12-30 21:57:51 +0800
commit618333cc27b1ec825400090778bdd1a03d3cf3dd (patch)
tree552f517d4f2c93419d9d11f0c99f84181990787e /script/library.lua
parent2f040f7bb5f30e9b101a8b08debcd0a3a4d1bdd1 (diff)
downloadlua-language-server-618333cc27b1ec825400090778bdd1a03d3cf3dd.zip
update
Diffstat (limited to 'script/library.lua')
-rw-r--r--script/library.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/script/library.lua b/script/library.lua
index 9b31410c..baa336f9 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -12,10 +12,11 @@ local await = require 'await'
local timer = require 'timer'
local encoder = require 'encoder'
local ws = require 'workspace.workspace'
-local scope = require 'workspace.scope'
local m = {}
+m.metaPaths = {}
+
local function getDocFormater(uri)
local version = config.get(uri, 'Lua.runtime.version')
if client.isVSCode() then
@@ -215,19 +216,16 @@ local function initBuiltIn(uri)
loadMetaLocale(langID, metaLang)
end
-
if scp:get('metaPath') == metaPath:string() then
return
end
scp:set('metaPath', metaPath:string())
- local suc, ok = xpcall(function ()
+ local suc = xpcall(function ()
if not fs.exists(metaPath) then
fs.create_directories(metaPath)
- return true
end
- return false
end, log.error)
- if not suc or not ok then
+ if not suc then
return
end
local out = fsu.dummyFS()
@@ -243,6 +241,8 @@ local function initBuiltIn(uri)
if metaDoc then
metaDoc = encoder.encode(encoding, metaDoc, 'auto')
out:saveFile(libName, metaDoc)
+ local outputPath = metaPath / libName
+ m.metaPaths[outputPath:string()] = true
end
::CONTINUE::
end
@@ -419,7 +419,6 @@ local function check3rdByFileName(uri, configs)
if hasAsked then
return
end
- local ws = require 'workspace'
local path = ws.getRelativePath(uri)
if not path then
return