diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-12 16:33:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-12 16:33:29 +0800 |
commit | ea2795520e68db8737bd6d0ab7a93d5e5a482346 (patch) | |
tree | 5f21f8392ad123497f52ab893e79cb3013879456 /script/workspace/workspace.lua | |
parent | 896a1affdeed8304688611674df88140a5cc180e (diff) | |
download | lua-language-server-ea2795520e68db8737bd6d0ab7a93d5e5a482346.zip |
cleanup
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index a1b54f24..45fd6595 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -49,13 +49,13 @@ function m.create(uri) uri = furi.normalize(uri) end log.info('Workspace create: ', uri) + local scp = scope.createFolder(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))) - return + scp:set('bad root', true) end - local scp = scope.createFolder(uri) - m.folders[#m.folders+1] = scp end function m.remove(uri) @@ -306,7 +306,7 @@ function m.awaitPreload(scp) local native = m.getNativeMatcher(scp) local librarys = m.getLibraryMatchers(scp) - if scp.uri then + if scp.uri and not scp:get('bad root') then log.info('Scan files at:', scp:getName()) local count = 0 ---@async |