summaryrefslogtreecommitdiff
path: root/script/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/files.lua')
-rw-r--r--script/files.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/files.lua b/script/files.lua
index 220a2ee2..ed9fd880 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -182,6 +182,7 @@ function m.setText(uri, text, isTrust)
file.version = file.version + 1
m.globalVersion = m.globalVersion + 1
await.close('files.version')
+ await.close('compile:' .. uri)
if create then
m.onWatch('create', originUri)
end
@@ -346,6 +347,7 @@ function m.eachDll()
end
function m.compileAst(uri, text)
+ await.setID('compile:' .. uri)
local ws = require 'workspace'
if not m.isOpen(uri) and #text >= config.config.workspace.preloadFileSize * 1000 then
if not m.notifyCache['preloadFileSize'] then
@@ -378,12 +380,14 @@ function m.compileAst(uri, text)
special = config.config.runtime.special,
unicodeName = config.config.runtime.unicodeName,
nonstandardSymbol = config.config.runtime.nonstandardSymbol,
+ delay = await.delay,
}
)
local passed = os.clock() - clock
if passed > 0.1 then
log.warn(('Compile [%s] takes [%.3f] sec, size [%.3f] kb.'):format(uri, passed, #text / 1000))
end
+ await.delay()
if state then
state.uri = uri
state.ast.uri = uri