summaryrefslogtreecommitdiff
path: root/script/src/uri.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-23 00:05:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-23 00:05:30 +0800
commit6da2b175e20ed3c03b0dfcfc9046de1e0e5d4444 (patch)
treefdc22d78150fd1c5edc46732c8b151ccfefb519f /script/src/uri.lua
parentd0ff66c9abe9d6abbca12fd811e0c3cb69c1033a (diff)
downloadlua-language-server-6da2b175e20ed3c03b0dfcfc9046de1e0e5d4444.zip
正路目录
Diffstat (limited to 'script/src/uri.lua')
-rw-r--r--script/src/uri.lua29
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,
-}