summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-05-10 16:18:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-05-10 16:18:30 +0800
commitc59bd7f4765a8016dfbbf3c8c9879387ca86acfd (patch)
tree7204c9c0fec3769242b35075de33a2f442391c08 /script
parentdc8f3536f05882e1c74021f071d4ed4340686b4d (diff)
downloadlua-language-server-c59bd7f4765a8016dfbbf3c8c9879387ca86acfd.zip
适配 bee.sys
Diffstat (limited to 'script')
-rw-r--r--script/files.lua3
-rw-r--r--script/filewatch.lua3
-rw-r--r--script/meta/bee/filesystem.lua7
-rw-r--r--script/meta/bee/filewatch.lua2
-rw-r--r--script/meta/bee/socket.lua2
-rw-r--r--script/meta/bee/sys.lua13
-rw-r--r--script/meta/bee/thread.lua2
7 files changed, 21 insertions, 11 deletions
diff --git a/script/files.lua b/script/files.lua
index b9df5695..68c3b8a5 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -1,5 +1,6 @@
local platform = require 'bee.platform'
local fs = require 'bee.filesystem'
+local sys = require 'bee.sys'
local config = require 'config'
local glob = require 'glob'
local furi = require 'file-uri'
@@ -70,7 +71,7 @@ local function getRealParent(path)
== path :string():gsub('^%w+:', string.lower) then
return path
end
- local res = fs.fullpath(path)
+ local res = sys.fullpath(path)
return getRealParent(parent) / res:filename()
end
diff --git a/script/filewatch.lua b/script/filewatch.lua
index 6520afe6..7fb3e605 100644
--- a/script/filewatch.lua
+++ b/script/filewatch.lua
@@ -1,6 +1,7 @@
local fw = require 'bee.filewatch'
local fs = require 'bee.filesystem'
local plat = require 'bee.platform'
+local sys = require 'bee.sys'
local await = require 'await'
local files = require 'files'
@@ -16,7 +17,7 @@ local function isExists(filename)
if plat.os ~= 'windows' then
return true
end
- local res = fs.fullpath(path)
+ local res = sys.fullpath(path)
if not res then
return false
end
diff --git a/script/meta/bee/filesystem.lua b/script/meta/bee/filesystem.lua
index 0c7e41a8..2a353065 100644
--- a/script/meta/bee/filesystem.lua
+++ b/script/meta/bee/filesystem.lua
@@ -1,4 +1,4 @@
----@meta
+---@meta bee.filesystem
---@class fs.path
---@operator div: fs.path
@@ -75,11 +75,6 @@ end
---@param path fs.path
---@return fs.path
-function fs.fullpath(path)
-end
-
----@param path fs.path
----@return fs.path
function fs.absolute(path)
end
diff --git a/script/meta/bee/filewatch.lua b/script/meta/bee/filewatch.lua
index b5211355..813548b2 100644
--- a/script/meta/bee/filewatch.lua
+++ b/script/meta/bee/filewatch.lua
@@ -1,4 +1,4 @@
----@meta
+---@meta bee.filewatch
---@class bee.filewatch.instance
local instance = {}
diff --git a/script/meta/bee/socket.lua b/script/meta/bee/socket.lua
index 55c349a6..b5e3a7b2 100644
--- a/script/meta/bee/socket.lua
+++ b/script/meta/bee/socket.lua
@@ -1,4 +1,4 @@
----@meta
+---@meta bee.socket
---@alias bee.socket.protocol
---| 'tcp'
diff --git a/script/meta/bee/sys.lua b/script/meta/bee/sys.lua
new file mode 100644
index 00000000..ad14702c
--- /dev/null
+++ b/script/meta/bee/sys.lua
@@ -0,0 +1,13 @@
+---@meta bee.sys
+
+---@class bee.sys
+local sys = {}
+
+---@param path fs.path
+---@return fs.path
+function sys.fullpath(path) end
+
+---@return fs.path
+function sys.exe_path() end
+
+return sys
diff --git a/script/meta/bee/thread.lua b/script/meta/bee/thread.lua
index 6b4323a4..2cfbbdcf 100644
--- a/script/meta/bee/thread.lua
+++ b/script/meta/bee/thread.lua
@@ -1,4 +1,4 @@
----@meta
+---@meta bee.thread
---@class bee.thread
local thread = {}