summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 3508116f..71062933 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -549,7 +549,14 @@ proto.on('textDocument/codeAction', function (params)
local uri = params.textDocument.uri
local range = params.range
local diagnostics = params.context.diagnostics
- local results = core(uri, range, diagnostics)
+ local text = files.getText(uri)
+ local lines = files.getLines(uri)
+ if not text or not lines then
+ return nil
+ end
+
+ local start, finish = define.unrange(lines, text, range)
+ local results = core(uri, start, finish, diagnostics)
if not results or #results == 0 then
return nil