diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 16:44:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 16:44:00 +0800 |
commit | 7937b23423c65f41718edc684cb310d23e8da78c (patch) | |
tree | e1c94c351ef86531f753fcba608092a2088fef4d /src/method/textDocument | |
parent | 54559007c3918a9b08f8c11172ba54e4944416c3 (diff) | |
download | lua-language-server-7937b23423c65f41718edc684cb310d23e8da78c.zip |
支持中文
Diffstat (limited to 'src/method/textDocument')
-rw-r--r-- | src/method/textDocument/definition.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/method/textDocument/definition.lua b/src/method/textDocument/definition.lua index d9378b58..9601cc4a 100644 --- a/src/method/textDocument/definition.lua +++ b/src/method/textDocument/definition.lua @@ -8,14 +8,14 @@ return function (lsp, params) return nil, '找不到文件:' .. uri end -- lua是从1开始的,因此都要+1 - local pos = parser.calcline.position(text, params.position.line + 1, params.position.character + 1) + local pos = parser.calcline.position_utf8(text, params.position.line + 1, params.position.character + 1) local suc, start, finish = matcher.definition(text, pos) if not suc then return {} end - local start_row, start_col = parser.calcline.rowcol(text, start) - local finish_row, finish_col = parser.calcline.rowcol(text, finish) + local start_row, start_col = parser.calcline.rowcol_utf8(text, start) + local finish_row, finish_col = parser.calcline.rowcol_utf8(text, finish) local response = { uri = uri, |