diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-08 19:13:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-08 19:13:50 +0800 |
commit | 2a8a23aec9cceec42f288750b3ed19ec8bd23fc7 (patch) | |
tree | a9cb5d3430c422a0e26035150c45a4732cf2e631 /server/src/method/textDocument/rename.lua | |
parent | b7217e6433587f7be77660f05f1b0257aeab02c8 (diff) | |
download | lua-language-server-2a8a23aec9cceec42f288750b3ed19ec8bd23fc7.zip |
不用每次指定编码了
Diffstat (limited to 'server/src/method/textDocument/rename.lua')
-rw-r--r-- | server/src/method/textDocument/rename.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/method/textDocument/rename.lua b/server/src/method/textDocument/rename.lua index bfb5cbba..6dd0d5ae 100644 --- a/server/src/method/textDocument/rename.lua +++ b/server/src/method/textDocument/rename.lua @@ -8,7 +8,7 @@ return function (lsp, params) return {} end -- lua是从1开始的,因此都要+1 - local position = lines:position(params.position.line + 1, params.position.character + 1, 'utf8') + local position = lines:position(params.position.line + 1, params.position.character + 1) local positions = matcher.rename(results, position, newName) if not positions then return {} @@ -17,8 +17,8 @@ return function (lsp, params) local TextEdit = {} for i, position in ipairs(positions) do local start, finish = position[1], position[2] - local start_row, start_col = lines:rowcol(start, 'utf8') - local finish_row, finish_col = lines:rowcol(finish, 'utf8') + local start_row, start_col = lines:rowcol(start) + local finish_row, finish_col = lines:rowcol(finish) TextEdit[i] = { newText = newName, range = { |