diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-23 00:05:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-23 00:05:30 +0800 |
commit | 6da2b175e20ed3c03b0dfcfc9046de1e0e5d4444 (patch) | |
tree | fdc22d78150fd1c5edc46732c8b151ccfefb519f /script/src/uri.lua | |
parent | d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a (diff) | |
download | lua-language-server-6da2b175e20ed3c03b0dfcfc9046de1e0e5d4444.zip |
正路目录
Diffstat (limited to 'script/src/uri.lua')
-rw-r--r-- | script/src/uri.lua | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/script/src/uri.lua b/script/src/uri.lua deleted file mode 100644 index 9053447c..00000000 --- a/script/src/uri.lua +++ /dev/null @@ -1,29 +0,0 @@ -local fs = require 'bee.filesystem' -local platform = require 'bee.platform' -local sandbox = require 'sandbox' -local luaUriPath = (ROOT / 'src' / '3rd' / 'lua-uri'):string() -local URI = sandbox('uri.lua', luaUriPath, io.open) -local URI_FILE = sandbox('uri/file.lua', luaUriPath, io.open) -local OS = platform.OS == 'Windows' and 'win32' or 'unix' - -local function decode(uri) - local obj = URI:new(uri) - if not obj.filesystem_path then - return nil - end - local fullPath = obj:filesystem_path(OS) - local path = fs.path(fullPath) - return path -end - -local function encode(path) - local fullPath = fs.absolute(ROOT / path) - local obj = URI_FILE.make_file_uri(fullPath:string(), OS) - local uri = obj:uri() - return uri -end - -return { - encode = encode, - decode = decode, -} |