summaryrefslogtreecommitdiff
path: root/server-beta/src/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/files.lua')
-rw-r--r--server-beta/src/files.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/server-beta/src/files.lua b/server-beta/src/files.lua
index 1873637d..67a13aa8 100644
--- a/server-beta/src/files.lua
+++ b/server-beta/src/files.lua
@@ -131,12 +131,31 @@ function m.getLines(uri)
uri = uri:lower()
end
local file = m.fileMap[uri]
+ if not file then
+ return nil
+ end
if not file.lines then
file.lines = parser:lines(file.text)
end
return file.lines
end
+--- 获取搜索器
+function m.getSearcher(uri)
+ if platform.OS == 'Windows' then
+ uri = uri:lower()
+ end
+ local file = m.fileMap[uri]
+ if not file then
+ return nil
+ end
+ if not file.searcher then
+ local seacher = require 'seacher'
+ file.searcher = seacher.create(uri)
+ end
+ return file.searcher
+end
+
--- 判断文件名相等
function m.eq(a, b)
if platform.OS == 'Windows' then