summaryrefslogtreecommitdiff
path: root/server-beta/src/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-09-21 22:01:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-09-21 22:01:55 +0800
commit6a12587f892138899ff230396e561e44f5dc7096 (patch)
tree3162f77ffdb158dceb3ea9c3796c05a42921f2f5 /server-beta/src/parser
parentfb655ed5de736db10f63192a9efe70c2cddf3e21 (diff)
downloadlua-language-server-6a12587f892138899ff230396e561e44f5dc7096.zip
终于接上一部分了
Diffstat (limited to 'server-beta/src/parser')
-rw-r--r--server-beta/src/parser/guide.lua16
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