summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/files.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/script/files.lua b/script/files.lua
index eb9fe97c..f5f2f1c5 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -210,9 +210,12 @@ function m.removeAllClosed()
end
--- 遍历文件
---- TODO: 协程不安全
function m.eachFile()
- return pairs(m.fileMap)
+ local map = {}
+ for uri, file in pairs(m.fileMap) do
+ map[uri] = file
+ end
+ return pairs(map)
end
function m.compileAst(uri, text)