diff options
Diffstat (limited to 'server-beta/src/proto/provider.lua')
-rw-r--r-- | server-beta/src/proto/provider.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server-beta/src/proto/provider.lua b/server-beta/src/proto/provider.lua index 4eb1a669..0c029a45 100644 --- a/server-beta/src/proto/provider.lua +++ b/server-beta/src/proto/provider.lua @@ -154,8 +154,9 @@ proto.on('textDocument/definition', function (params) if not ast then return nil end + local lines = files.getLines(uri) local text = files.getText(uri) - local offset = inte.offset(ast.lines, text, params.position) + local offset = inte.offset(lines, text, params.position) local result = core(ast, text, offset) if not result then return nil @@ -163,9 +164,9 @@ proto.on('textDocument/definition', function (params) local response = {} for i, info in ipairs(result) do response[i] = inte.locationLink(info.uri - , inte.range(ast.lines, text, info.target.start - 1, info.target.finish) - , inte.range(ast.lines, text, info.target.start - 1, info.target.finish) - , inte.range(ast.lines, text, info.source.start - 1, info.source.finish) + , inte.range(lines, text, info.target.start - 1, info.target.finish) + , inte.range(lines, text, info.target.start - 1, info.target.finish) + , inte.range(lines, text, info.source.start - 1, info.source.finish) ) end return response |