diff options
author | xl000 <l_xb@foxmail.com> | 2019-04-17 01:16:12 +0800 |
---|---|---|
committer | xl000 <l_xb@foxmail.com> | 2019-04-17 01:16:12 +0800 |
commit | ae53ebf48299680b8906e848903fb32d56ee90a5 (patch) | |
tree | b4c2c5a410b8cff43e46f22101e372253b6472a5 /server/src | |
parent | e676b97ee6c54ac843b51f2d6062689a428f0c28 (diff) | |
download | lua-language-server-ae53ebf48299680b8906e848903fb32d56ee90a5.zip |
Unix-like系统路径问题,osx下测试通过
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/workspace.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/workspace.lua b/server/src/workspace.lua index 2837f5a2..ef449e1a 100644 --- a/server/src/workspace.lua +++ b/server/src/workspace.lua @@ -52,6 +52,10 @@ local mt = {} mt.__index = mt function mt:uriDecode(uri) + -- Unix-like系统根是/ + if uri:sub(1, 9) == 'file:////' then + return fs.path(uri:sub(9)) + end if uri:sub(1, 8) ~= 'file:///' then log.error('uri decode failed: ', uri) return nil |