summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/document_symbol.lua3
-rw-r--r--server/src/core/rename.lua2
-rw-r--r--server/src/core/vm.lua3
3 files changed, 6 insertions, 2 deletions
diff --git a/server/src/core/document_symbol.lua b/server/src/core/document_symbol.lua
index 61d58772..5b69de2e 100644
--- a/server/src/core/document_symbol.lua
+++ b/server/src/core/document_symbol.lua
@@ -83,6 +83,9 @@ local function buildLocal(vm, loc)
if loc.value and loc.value.type == 'function' then
return nil
end
+ if loc.hide then
+ return nil
+ end
local range = { loc.source.start, loc.source.finish }
local hvr = hover(loc, loc.source)
return {
diff --git a/server/src/core/rename.lua b/server/src/core/rename.lua
index 459aabcc..f42da08b 100644
--- a/server/src/core/rename.lua
+++ b/server/src/core/rename.lua
@@ -6,7 +6,7 @@ local function parseResult(result, source, newName)
local tp = result.type
if tp == 'local' or tp == 'field' then
local key = source[1]
- if result.disableRename then
+ if result.hide then
return positions
end
if source.index then
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index 5ccada8e..755b2e7c 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -403,7 +403,7 @@ function mt:buildFunction(exp, object)
if object then
local var = self:createArg('self', object.source, self:getValue(object))
- var.disableRename = true
+ var.hide = true
func.args[1] = var
end
@@ -1437,6 +1437,7 @@ function mt:createEnvironment()
self.results.main = self.chunk.func
-- 隐藏的上值`_ENV`
local parent = self:createLocal('_ENV')
+ parent.hide = true
local envValue = self:setValue(parent, self:buildTable())
-- _ENV 有个特殊标记
envValue.ENV = true