summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-22 21:44:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-22 21:44:54 +0800
commit9990b45689cfeb4a0b24fa9e6bbc6cc631910d22 (patch)
treeeacb1e613ae141c2115a667976f97794290b90c0 /script-beta
parent72631627e113ae191f15d327f1b44cacd8b601f1 (diff)
downloadlua-language-server-9990b45689cfeb4a0b24fa9e6bbc6cc631910d22.zip
处理一下斜杠方向
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/workspace/require-path.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script-beta/workspace/require-path.lua b/script-beta/workspace/require-path.lua
index 283e0112..79642a7f 100644
--- a/script-beta/workspace/require-path.lua
+++ b/script-beta/workspace/require-path.lua
@@ -1,3 +1,4 @@
+local platform = require 'bee.platform'
local m = {}
m.cache = {}
@@ -35,6 +36,11 @@ function m.getVisiblePath(path, searchers)
end
pos = path:match('[/\\]+()', pos)
for _, searcher in ipairs(searchers) do
+ if platform.OS == 'Windows' then
+ searcher = searcher:gsub('[/\\]+', '\\')
+ else
+ searcher = searcher:gsub('[/\\]+', '/')
+ end
local expect = getOnePath(cutedPath, searcher)
if expect then
if head then