diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-22 15:24:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-22 15:24:40 +0800 |
commit | d09c74c69306fa5b3deb0db68552c9223b6d76df (patch) | |
tree | cbb3df36e3fb9cd0a63b643a991a4976c22f9007 /script/workspace/workspace.lua | |
parent | b30e4ff8f33b504880066faea7143342e9aea4f2 (diff) | |
download | lua-language-server-d09c74c69306fa5b3deb0db68552c9223b6d76df.zip |
refactor `require-path`
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index b719c3e5..c2a5dfc0 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -394,16 +394,12 @@ function m.normalize(path) return path end ----@return string? +---@param folderUri uri +---@param path string +---@return string function m.getAbsolutePath(folderUri, path) - if not path or path == '' then - return nil - end path = m.normalize(path) if fs.path(path):is_relative() then - if not folderUri then - return nil - end local folderPath = furi.decode(folderUri) path = m.normalize(folderPath .. '/' .. path) end |