summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2022-01-23 05:17:35 +0800
committersumneko <sumneko@hotmail.com>2022-01-23 05:17:35 +0800
commitd9a7e4bf6b521d60aef110a62a053d417416af85 (patch)
tree3b7ea57ee190cf98426696520523e3cb11b215e3 /script/provider
parentc4dd7789e723f28976dd5edd2e32e374ef937883 (diff)
downloadlua-language-server-d9a7e4bf6b521d60aef110a62a053d417416af85.zip
cleanup
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/provider.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 66999aa0..dc267dae 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -225,7 +225,9 @@ m.register 'textDocument/didOpen' {
local uri = files.getRealUri(doc.uri)
workspace.awaitReady(uri)
local text = doc.text
- files.setText(uri, text, true, doc.version)
+ files.setText(uri, text, true, function (file)
+ file.version = doc.version
+ end)
files.open(uri)
end
}
@@ -253,7 +255,9 @@ m.register 'textDocument/didChange' {
local text = files.getOriginText(uri) or ''
local rows = files.getCachedRows(uri)
text, rows = tm(text, rows, changes)
- files.setText(uri, text, true, doc.version)
+ files.setText(uri, text, true, function (file)
+ file.version = doc.version
+ end)
files.setCachedRows(uri, rows)
end
}