Skip to content

Commit

Permalink
fix #1217
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jun 16, 2022
1 parent 073afa5 commit 5f48be0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 3.3.1
* `FIX` [#1213](https://github.com/sumneko/lua-language-server/issues/1213)
* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215)
* `FIX` [#1217](https://github.com/sumneko/lua-language-server/issues/1217)

## 3.3.0
`2022-6-15`
Expand Down
7 changes: 6 additions & 1 deletion script/provider/provider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ m.register 'textDocument/didClose' {
}

m.register 'textDocument/didChange' {
---@async
function (params)
local doc = params.textDocument
local scheme = furi.split(doc.uri)
Expand All @@ -274,7 +275,11 @@ m.register 'textDocument/didChange' {
end
local changes = params.contentChanges
local uri = files.getRealUri(doc.uri)
local text = files.getOriginText(uri) or ''
local text = files.getOriginText(uri)
if not text then
files.setText(uri, pub.awaitTask('loadFile', furi.decode(uri)), false)
return
end
local rows = files.getCachedRows(uri)
text, rows = tm(text, rows, changes)
files.setText(uri, text, true, function (file)
Expand Down

0 comments on commit 5f48be0

Please sign in to comment.