diff options
Diffstat (limited to 'server/src/method/textDocument/definition.lua')
-rw-r--r-- | server/src/method/textDocument/definition.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua index 6be93ff8..9115638b 100644 --- a/server/src/method/textDocument/definition.lua +++ b/server/src/method/textDocument/definition.lua @@ -15,11 +15,12 @@ return function (lsp, params) local locations = {} for i, position in ipairs(positions) do - local start, finish, valueUri = position[1], position[2], position[3] - local start_row, start_col = lines:rowcol(start) - local finish_row, finish_col = lines:rowcol(finish) + local start, finish, valueUri = position[1], position[2], (position[3] or uri) + local _, valueLines = lsp:loadVM(valueUri) + local start_row, start_col = valueLines:rowcol(start) + local finish_row, finish_col = valueLines:rowcol(finish) locations[i] = { - uri = valueUri or uri, + uri = valueUri, range = { start = { line = start_row - 1, |