diff options
author | CppCXY <812125110@qq.com> | 2024-02-22 20:29:13 +0800 |
---|---|---|
committer | CppCXY <812125110@qq.com> | 2024-02-22 20:29:13 +0800 |
commit | 9b6df71d97a70ee7179949ef9f15368cbf29dcbd (patch) | |
tree | bf7a7e62ed7c164a12bdce437c17262a5235bcec /script/workspace/workspace.lua | |
parent | 483fe246b6ae8c25d433aa15e43f04f0e71a74d5 (diff) | |
parent | 3e6fd3ce1f2f0528336ded939d776a29bbfaf2eb (diff) | |
download | lua-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.lua | 12 |
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) |