summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-17 15:28:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-17 15:28:12 +0800
commit4914f316d042aa907900170dc9b2adb0134f93a8 (patch)
tree398a7815590e4f2a0ce03a1382003c305690bf87 /server/src
parent7ecf149287d967dcaeeed8485b5867fa76653c6c (diff)
downloadlua-language-server-4914f316d042aa907900170dc9b2adb0134f93a8.zip
要复制一份出来
Diffstat (limited to 'server/src')
-rw-r--r--server/src/matcher/library.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/src/matcher/library.lua b/server/src/matcher/library.lua
index 19e3b8e0..f6211431 100644
--- a/server/src/matcher/library.lua
+++ b/server/src/matcher/library.lua
@@ -65,6 +65,14 @@ local function mergeSource(alllibs, name, lib)
end
end
+local function copy(t)
+ local new = {}
+ for k, v in pairs(t) do
+ new[k] = v
+ end
+ return new
+end
+
local function insert(tbl, name, key, value)
if not name or not key then
return
@@ -76,7 +84,7 @@ local function insert(tbl, name, key, value)
child = {},
}
end
- tbl[name].child[key] = value
+ tbl[name].child[key] = copy(value)
end
local function mergeParent(alllibs, name, lib)