diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-25 17:02:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-25 17:02:28 +0800 |
commit | 41c0a3671ec1cc704a9414f75772542ceaaf60d4 (patch) | |
tree | 8193c57282dda1e87795e497194eb7a54648f7d4 /script/workspace/scope.lua | |
parent | bccfab54e367efe4d2b3e34fabb28bf1c481434e (diff) | |
download | lua-language-server-41c0a3671ec1cc704a9414f75772542ceaaf60d4.zip |
fix #925
Diffstat (limited to 'script/workspace/scope.lua')
-rw-r--r-- | script/workspace/scope.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script/workspace/scope.lua b/script/workspace/scope.lua index 711fc1a1..304e875e 100644 --- a/script/workspace/scope.lua +++ b/script/workspace/scope.lua @@ -56,6 +56,20 @@ function mt:isLinkedUri(uri) return false end +---@param uri uri +---@return uri? +function mt:getLinkedUri(uri) + if not uri then + return nil + end + for linkUri in pairs(self._links) do + if uri:sub(1, #linkUri) == linkUri then + return linkUri + end + end + return nil +end + ---@param k string ---@param v any function mt:set(k, v) |