diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-10 23:36:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-10 23:36:54 +0800 |
commit | 23f0c601cbc175b1acdca271423cbcb372abfc38 (patch) | |
tree | 81832172eda66c39a1baaee9811e7f490aae5a51 /server-beta/src | |
parent | ffc383d45e4a4a21958ec88ae8815c4683d3f2f4 (diff) | |
download | lua-language-server-23f0c601cbc175b1acdca271423cbcb372abfc38.zip |
修正range坐标转换的bug
Diffstat (limited to 'server-beta/src')
-rw-r--r-- | server-beta/src/proto/define.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server-beta/src/proto/define.lua b/server-beta/src/proto/define.lua index 1bf45531..62c85989 100644 --- a/server-beta/src/proto/define.lua +++ b/server-beta/src/proto/define.lua @@ -43,10 +43,12 @@ end ---@param offset1 integer ---@param offset2 integer function m.range(lines, text, offset1, offset2) - return { - start = m.position(lines, text, offset1-1), + local range = { + start = m.position(lines, text, offset1), ['end'] = m.position(lines, text, offset2), } + range.start.character = range.start.character - 1 + return range end ---@alias location table |