diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-02-02 11:24:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-02-02 11:24:54 +0800 |
commit | a08e06cf9e23e27e8f274710cbd45947579fa8c6 (patch) | |
tree | 8baf1c5de3acb9144c78700eef8ce3a1c5c900e0 /script/files.lua | |
parent | 2a546145f61d9d0c461cd6f77340452e0ba4e982 (diff) | |
download | lua-language-server-a08e06cf9e23e27e8f274710cbd45947579fa8c6.zip |
file operations no longer reload workspace
Diffstat (limited to 'script/files.lua')
-rw-r--r-- | script/files.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script/files.lua b/script/files.lua index 60119b8d..2e0c2666 100644 --- a/script/files.lua +++ b/script/files.lua @@ -206,6 +206,20 @@ function m.getOriginText(uri) return file.originText end +function m.getChildFiles(uri) + uri = getUriKey(uri) + local results = {} + local uris = m.getAllUris() + for _, curi in ipairs(uris) do + if #curi > #uri + and curi:sub(1, #uri) == uri + and curi:sub(#uri+1, #uri+1):match '[/\\]' then + results[#results+1] = curi + end + end + return results +end + --- 移除文件 ---@param uri uri function m.remove(uri) |