summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
authorCppCXY <812125110@qq.com>2024-02-22 20:29:13 +0800
committerCppCXY <812125110@qq.com>2024-02-22 20:29:13 +0800
commit9b6df71d97a70ee7179949ef9f15368cbf29dcbd (patch)
treebf7a7e62ed7c164a12bdce437c17262a5235bcec /script/workspace/workspace.lua
parent483fe246b6ae8c25d433aa15e43f04f0e71a74d5 (diff)
parent3e6fd3ce1f2f0528336ded939d776a29bbfaf2eb (diff)
downloadlua-language-server-9b6df71d97a70ee7179949ef9f15368cbf29dcbd.zip
Merge branch 'master' of github.com:CppCXY/lua-language-server
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 3e85e0fc..97518e84 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -50,8 +50,10 @@ function m.create(uri)
m.folders[#m.folders+1] = scp
if uri == furi.encode '/'
or uri == furi.encode(os.getenv 'HOME' or '') then
- client.showMessage('Error', lang.script('WORKSPACE_NOT_ALLOWED', furi.decode(uri)))
- scp:set('bad root', true)
+ if not FORCE_ACCEPT_WORKSPACE then
+ client.showMessage('Error', lang.script('WORKSPACE_NOT_ALLOWED', furi.decode(uri)))
+ scp:set('bad root', true)
+ end
end
end
@@ -469,10 +471,6 @@ function m.flushFiles(scp)
for uri in pairs(cachedUris) do
files.delRef(uri)
end
- collectgarbage()
- collectgarbage()
- -- TODO: wait maillist
- collectgarbage 'restart'
end
---@param scp scope
@@ -493,6 +491,8 @@ end
---@async
---@param scp scope
function m.awaitReload(scp)
+ await.unique('workspace reload:' .. scp:getName())
+ await.sleep(0.1)
scp:set('ready', false)
scp:set('nativeMatcher', nil)
scp:set('libraryMatcher', nil)