summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/provider/provider.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 319d00a9..a01b5d10 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -261,6 +261,7 @@ m.register 'workspace/didChangeWorkspaceFolders' {
}
m.register 'textDocument/didOpen' {
+ ---@async
function (params)
local doc = params.textDocument
local scheme = furi.split(doc.uri)
@@ -270,6 +271,7 @@ m.register 'textDocument/didOpen' {
end
local uri = files.getRealUri(doc.uri)
log.debug('didOpen', uri)
+ workspace.awaitReady(uri)
local text = doc.text
files.setText(uri, text, true, function (file)
file.version = doc.version
@@ -301,6 +303,7 @@ m.register 'textDocument/didChange' {
end
local changes = params.contentChanges
local uri = files.getRealUri(doc.uri)
+ workspace.awaitReady(uri)
local text = files.getOriginText(uri)
if not text then
files.setText(uri, pub.awaitTask('loadFile', furi.decode(uri)), false)