summaryrefslogtreecommitdiff
path: root/script/core/diagnostics/spell-check.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/diagnostics/spell-check.lua')
-rw-r--r--script/core/diagnostics/spell-check.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/script/core/diagnostics/spell-check.lua b/script/core/diagnostics/spell-check.lua
index 7369a235..a4cb87be 100644
--- a/script/core/diagnostics/spell-check.lua
+++ b/script/core/diagnostics/spell-check.lua
@@ -6,10 +6,11 @@ local spell = require 'provider.spell'
---@async
return function(uri, callback)
- local text = files.getOriginText(uri)
- if not text then
+ local state = files.getState(uri)
+ if not state then
return
end
+ local text = state.originText
local status, diagnosticInfos = spell.spellCheck(uri, text)
@@ -24,8 +25,8 @@ return function(uri, callback)
if diagnosticInfos then
for _, diagnosticInfo in ipairs(diagnosticInfos) do
callback {
- start = converter.unpackPosition(uri, diagnosticInfo.range.start),
- finish = converter.unpackPosition(uri, diagnosticInfo.range["end"]),
+ start = converter.unpackPosition(state, diagnosticInfo.range.start),
+ finish = converter.unpackPosition(state, diagnosticInfo.range["end"]),
message = diagnosticInfo.message,
data = diagnosticInfo.data
}