diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-22 21:44:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-22 21:44:54 +0800 |
commit | 9990b45689cfeb4a0b24fa9e6bbc6cc631910d22 (patch) | |
tree | eacb1e613ae141c2115a667976f97794290b90c0 /script-beta | |
parent | 72631627e113ae191f15d327f1b44cacd8b601f1 (diff) | |
download | lua-language-server-9990b45689cfeb4a0b24fa9e6bbc6cc631910d22.zip |
处理一下斜杠方向
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/workspace/require-path.lua | 6 |
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 |