summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-07 17:26:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-07 17:26:44 +0800
commit60332a2cceb05a0160d76d6182c756afa0571fae (patch)
tree4d741dae79a59a50bec9ba82d5f0d279b5cc861e /script
parent3b3c7ade4f8722e584ed13c8099d4fa3316edbdd (diff)
downloadlua-language-server-60332a2cceb05a0160d76d6182c756afa0571fae.zip
don't show again
Diffstat (limited to 'script')
-rw-r--r--script/library.lua32
1 files changed, 26 insertions, 6 deletions
diff --git a/script/library.lua b/script/library.lua
index 5575ad6c..ded12a27 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -403,6 +403,15 @@ local function askFor3rd(uri, cfg)
uri = uri,
},
}, true)
+ else
+ client.setConfig({
+ {
+ key = 'Lua.workspace.checkThirdParty',
+ action = 'set',
+ value = false,
+ uri = uri,
+ },
+ }, false)
end
end
@@ -479,10 +488,14 @@ local function check3rdByFileName(uri, configs)
end
local thirdConfigs
+---@async
local function check3rd(uri)
if hasAsked then
return
end
+ if ws.isIgnored(uri) then
+ return
+ end
if not config.get(uri, 'Lua.workspace.checkThirdParty') then
return
end
@@ -497,12 +510,18 @@ local function check3rd(uri)
end
local function check3rdOfWorkspace(suri)
- for uri in files.eachFile(suri) do
- check3rd(uri)
- end
- for uri in files.eachDll() do
- check3rd(uri)
- end
+ local id = 'check3rdOfWorkspace:' .. suri
+ await.close(id)
+ ---@async
+ await.call(function ()
+ ws.awaitReady(suri)
+ for uri in files.eachFile(suri) do
+ check3rd(uri)
+ end
+ for uri in files.eachDll() do
+ check3rd(uri)
+ end
+ end, id)
end
config.watch(function (uri, key, value, oldValue)
@@ -515,6 +534,7 @@ config.watch(function (uri, key, value, oldValue)
end
end)
+---@async
files.watch(function (ev, uri)
if ev == 'update'
or ev == 'dll' then