summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-05 19:59:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-05 20:00:16 +0800
commit9b6b699a6943f6f77af19b8af04644ec2d337983 (patch)
tree6b1d0b617cb8fb3b00d93fbbd6d460f09d96be30
parent2d891ce551b2fe4eaf43a5b9ba68e79df2ee68fa (diff)
downloadlua-language-server-9b6b699a6943f6f77af19b8af04644ec2d337983.zip
stash
-rw-r--r--script/vm/variable-id.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/variable-id.lua b/script/vm/variable-id.lua
index e5257776..ce4f5f97 100644
--- a/script/vm/variable-id.lua
+++ b/script/vm/variable-id.lua
@@ -6,6 +6,8 @@ local vm = require 'vm.vm'
---@class vm.variable
---@field sets parser.object[]
---@field gets parser.object[]
+---@field node? vm.node
+---@field type 'global'|'local'
---@class parser.object
---@field package _variableID string|false
@@ -119,8 +121,9 @@ end
function vm.insertVariableID(id, source)
local root = guide.getRoot(source)
if not root._variableIDs then
- root._variableIDs = util.multiTable(2, function ()
+ root._variableIDs = util.multiTable(2, function (head)
return {
+ type = head:sub(1, 1) == 'l' and 'local' or 'global',
sets = {},
gets = {},
}