diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-10 20:41:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-10 20:41:30 +0800 |
commit | e112035b49171693d2c492e329eae2df23ad0c87 (patch) | |
tree | 3be82b760d539a3ef0adab21bca75e82aeaf0223 /script/parser/guide.lua | |
parent | 14760a600837ec760fd9874bcc1076db4cfeb7dc (diff) | |
download | lua-language-server-e112035b49171693d2c492e329eae2df23ad0c87.zip |
fix
Diffstat (limited to 'script/parser/guide.lua')
-rw-r--r-- | script/parser/guide.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 544f3eaa..9c7f057d 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -802,6 +802,17 @@ function m.offsetToPosition(state, offset) return m.offsetToPositionByLines(state.lines, offset) end +function m.getLineRange(state, row) + local nextLineStart = state.lines[row + 1] or #state.lua + for i = nextLineStart - 1, state.lines[row], -1 do + local w = state.lua:sub(i, i) + if w ~= '\r' and w ~= '\n' then + return i - state.lines[row] + 1 + end + end + return 0 +end + local isSetMap = { ['setglobal'] = true, ['local'] = true, |