diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-22 16:36:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-22 16:36:29 +0800 |
commit | 1cc1be17cd3af205fda7ec80b333bf020a929fda (patch) | |
tree | d5da46d9932d4cb2677430dec168c0ea37bc7eb6 /script/workspace/workspace.lua | |
parent | d09c74c69306fa5b3deb0db68552c9223b6d76df (diff) | |
download | lua-language-server-1cc1be17cd3af205fda7ec80b333bf020a929fda.zip |
handle `../?.lua`
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index c2a5dfc0..60078975 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -383,6 +383,13 @@ function m.normalize(path) end) path = util.expandPath(path) path = path:gsub('^%.[/\\]+', '') + for _ = 1, 1000 do + local count + path, count = path:gsub('[^/\\]+[/\\]%.%.', '') + if count == 0 then + break + end + end if platform.OS == 'Windows' then path = path:gsub('[/\\]+', '\\') :gsub('[/\\]+$', '') |