diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-07 11:07:23 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-07 11:07:23 +0800 |
commit | 8209df638b5e16f02dd9e9b2d689a40ef61b5127 (patch) | |
tree | 5353a337d26c89f3fb4fc1a0e0fe882b6974606e | |
parent | 7530d7551220961f8e8b8346a8eb33fc03863694 (diff) | |
download | lua-language-server-8209df638b5e16f02dd9e9b2d689a40ef61b5127.zip |
Revert "fix"
This reverts commit 7530d7551220961f8e8b8346a8eb33fc03863694.
-rw-r--r-- | script/core/hover/description.lua | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index a00c16dd..ddb84770 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -28,22 +28,20 @@ local function asStringInRequire(source, literal) for i, uri in ipairs(result) do local searcher = searchers and searchers[uri] uri = files.getOriginUri(uri) - if uri then - local path = furi.decode(uri) - if files.eq(path:sub(1, #rootPath), rootPath) then - path = path:sub(#rootPath + 1) - end - path = path:gsub('^[/\\]*', '') - if vm.isMetaFile(uri) then - result[i] = ('* [[meta]](%s)'):format(uri) - elseif searcher then - searcher = searcher:sub(#rootPath + 1) - searcher = ws.normalize(searcher) - searcher = searcher:gsub('^[/\\]+', '') - result[i] = ('* [%s](%s) %s'):format(path, uri, lang.script('HOVER_USE_LUA_PATH', searcher)) - else - result[i] = ('* [%s](%s)'):format(path, uri) - end + local path = furi.decode(uri) + if files.eq(path:sub(1, #rootPath), rootPath) then + path = path:sub(#rootPath + 1) + end + path = path:gsub('^[/\\]*', '') + if vm.isMetaFile(uri) then + result[i] = ('* [[meta]](%s)'):format(uri) + elseif searcher then + searcher = searcher:sub(#rootPath + 1) + searcher = ws.normalize(searcher) + searcher = searcher:gsub('^[/\\]+', '') + result[i] = ('* [%s](%s) %s'):format(path, uri, lang.script('HOVER_USE_LUA_PATH', searcher)) + else + result[i] = ('* [%s](%s)'):format(path, uri) end end table.sort(result) |