summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-11 18:19:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-11 18:19:30 +0800
commit2e4f530b33467b94376321c7f9879f2a879429bb (patch)
tree47f3fb4cef9e6cffe9d5484b2ce8cad663c4786e /script/workspace
parent4f98d5565b416f71d605cafcb22bd76cf697fd03 (diff)
downloadlua-language-server-2e4f530b33467b94376321c7f9879f2a879429bb.zip
fix #1036
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/scope.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/script/workspace/scope.lua b/script/workspace/scope.lua
index be112af2..a0f4fbf7 100644
--- a/script/workspace/scope.lua
+++ b/script/workspace/scope.lua
@@ -1,5 +1,8 @@
local gc = require 'gc'
+---@class scope.manager
+local m = {}
+
---@alias scope.type '"override"'|'"folder"'|'"fallback"'
---@class scope
@@ -60,6 +63,14 @@ function mt:isLinkedUri(uri)
end
---@param uri uri
+---@return boolean
+function mt:isVisible(uri)
+ return self:isChildUri(uri)
+ or self:isLinkedUri(uri)
+ or self == m.getScope(uri)
+end
+
+---@param uri uri
---@return uri?
function mt:getLinkedUri(uri)
if not uri then
@@ -122,9 +133,6 @@ local function createScope(scopeType)
return scope
end
----@class scope.manager
-local m = {}
-
function m.reset()
---@type scope[]
m.folders = {}