diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-21 22:01:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-21 22:01:55 +0800 |
commit | 6a12587f892138899ff230396e561e44f5dc7096 (patch) | |
tree | 3162f77ffdb158dceb3ea9c3796c05a42921f2f5 /server-beta/src/parser | |
parent | fb655ed5de736db10f63192a9efe70c2cddf3e21 (diff) | |
download | lua-language-server-6a12587f892138899ff230396e561e44f5dc7096.zip |
终于接上一部分了
Diffstat (limited to 'server-beta/src/parser')
-rw-r--r-- | server-beta/src/parser/guide.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server-beta/src/parser/guide.lua b/server-beta/src/parser/guide.lua index 061efaec..7cec136d 100644 --- a/server-beta/src/parser/guide.lua +++ b/server-beta/src/parser/guide.lua @@ -230,4 +230,20 @@ function m.offsetOf(lines, row, col) end end +function m.lineContent(lines, text, row) + local line = lines[row] + if not line then + return '' + end + return text:sub(line.start + 1, line.finish) +end + +function m.lineRange(lines, row) + local line = lines[row] + if not line then + return 0, 0 + end + return line.start + 1, line.finish +end + return m |