diff options
author | sumneko <sumneko@hotmail.com> | 2021-12-02 22:16:18 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2021-12-02 22:16:18 +0800 |
commit | c47baf932309a05673b7931fdf6a1be207fb7bc4 (patch) | |
tree | 2869d38a1472045ee9075083d14ca31ae6b35dd1 /script/provider | |
parent | b6da7274e8fa773183146982f8864247bb33a214 (diff) | |
parent | cb2042160865589b5534a6bf0b6c366ae4ab1d99 (diff) | |
download | lua-language-server-c47baf932309a05673b7931fdf6a1be207fb7bc4.zip |
Merge remote-tracking branch 'origin/master' into multi-workspace
Diffstat (limited to 'script/provider')
-rw-r--r-- | script/provider/diagnostic.lua | 5 | ||||
-rw-r--r-- | script/provider/provider.lua | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 5630d44f..a6724a29 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -223,8 +223,6 @@ function m.doDiagnostic(uri) local version = files.getVersion(uri) - await.setID('diag:' .. uri) - local prog <close> = progress.create(lang.script.WINDOW_DIAGNOSING, 0.5) prog:setMessage(ws.getRelativePath(uri)) @@ -277,8 +275,9 @@ function m.refresh(uri) end await.close('diag:' .. uri) await.call(function () ---@async - await.delay() if uri then + await.setID('diag:' .. uri) + await.sleep(0.1) m.clearCache(uri) xpcall(m.doDiagnostic, log.error, uri) end diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 41338e59..11501b9c 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -215,8 +215,7 @@ m.register 'textDocument/didOpen' { local uri = files.getRealUri(doc.uri) workspace.awaitReady(uri) local text = doc.text - log.debug('didOpen', uri) - files.setText(uri, text, true) + files.setText(uri, text, true, doc.version) files.open(uri) end } @@ -244,7 +243,7 @@ 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) + files.setText(uri, text, true, doc.version) files.setCachedRows(uri, rows) end } |