summaryrefslogtreecommitdiff
path: root/script/workspace/scope.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/workspace/scope.lua')
-rw-r--r--script/workspace/scope.lua21
1 files changed, 9 insertions, 12 deletions
diff --git a/script/workspace/scope.lua b/script/workspace/scope.lua
index 16c9500d..8bf91c71 100644
--- a/script/workspace/scope.lua
+++ b/script/workspace/scope.lua
@@ -37,6 +37,7 @@ end
---@param v any
function mt:set(k, v)
self._data[k] = v
+ return v
end
---@param k string
@@ -45,16 +46,6 @@ function mt:get(k)
return self._data[k]
end
----@class scope.manager
-local m = {}
-
----@type scope[]
-m.folders = {}
----@type scope
-m.override = nil
----@type scope
-m.fallback = nil
-
---@param scopeType scope.type
---@return scope
local function createScope(scopeType)
@@ -67,6 +58,14 @@ local function createScope(scopeType)
return scope
end
+---@class scope.manager
+local m = {}
+
+---@type scope[]
+m.folders = {}
+m.override = createScope 'override'
+m.fallback = createScope 'fallback'
+
---@param uri uri
---@return scope
function m.createFolder(uri)
@@ -115,6 +114,4 @@ function m.getLinkedScope(uri)
end
end
-m.fallback = createScope 'fallback'
-
return m