summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/definition.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-21 15:41:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-21 15:41:59 +0800
commita67da00e8e2b61a2fa197188b7ffb3e3b83a2a74 (patch)
tree749c08fa9ad3e5131c24592c72db121e1bb9d601 /server/src/method/textDocument/definition.lua
parentb80dc1e6acaf9df1c2f53ca83f0ed9cbf8e1fa71 (diff)
downloadlua-language-server-a67da00e8e2b61a2fa197188b7ffb3e3b83a2a74.zip
更加准确的分词
Diffstat (limited to 'server/src/method/textDocument/definition.lua')
-rw-r--r--server/src/method/textDocument/definition.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua
index a9c05752..e1c45317 100644
--- a/server/src/method/textDocument/definition.lua
+++ b/server/src/method/textDocument/definition.lua
@@ -17,7 +17,7 @@ return function (lsp, params)
return nil
end
-- lua是从1开始的,因此都要+1
- local position = lines:position(params.position.line + 1, params.position.character + 1)
+ local position = lines:positionAsChar(params.position.line + 1, params.position.character)
local source = core.findSource(vm, position)
if not source then
return nil