Skip to content

Commit 5f48be0

Browse files
committed
fix #1217
1 parent 073afa5 commit 5f48be0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 3.3.1
44
* `FIX` [#1213](https://github.com/sumneko/lua-language-server/issues/1213)
55
* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215)
6+
* `FIX` [#1217](https://github.com/sumneko/lua-language-server/issues/1217)
67

78
## 3.3.0
89
`2022-6-15`

script/provider/provider.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ m.register 'textDocument/didClose' {
265265
}
266266

267267
m.register 'textDocument/didChange' {
268+
---@async
268269
function (params)
269270
local doc = params.textDocument
270271
local scheme = furi.split(doc.uri)
@@ -274,7 +275,11 @@ m.register 'textDocument/didChange' {
274275
end
275276
local changes = params.contentChanges
276277
local uri = files.getRealUri(doc.uri)
277-
local text = files.getOriginText(uri) or ''
278+
local text = files.getOriginText(uri)
279+
if not text then
280+
files.setText(uri, pub.awaitTask('loadFile', furi.decode(uri)), false)
281+
return
282+
end
278283
local rows = files.getCachedRows(uri)
279284
text, rows = tm(text, rows, changes)
280285
files.setText(uri, text, true, function (file)

0 commit comments

Comments
 (0)