summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-16 17:31:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-18 17:10:59 +0800
commit3843e72b87de1aa8903352d532dbdb60ed662da1 (patch)
tree626861e124ad08272b31d24e0c4701c2f90d5e3a
parent19d38a540f37eff20c7fad1f35143f685a1831eb (diff)
downloadlua-language-server-3843e72b87de1aa8903352d532dbdb60ed662da1.zip
update
-rw-r--r--script/core/noder.lua5
-rw-r--r--test/crossfile/allreferences.lua4
-rw-r--r--test/rename/init.lua3
3 files changed, 8 insertions, 4 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index f7cfc785..79cff366 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -766,10 +766,7 @@ local function bindValue(noders, source, id)
-- x = y : x -> y
pushForward(noders, id, valueID, INFO_REJECT_SET)
if not config.get 'Lua.IntelliSense.traceBeSetted'
- and source.type ~= 'local'
- and source.type ~= 'tablefield'
- and source.type ~= 'tableindex'
- and source.type ~= 'setglobal' then
+ and source.type ~= 'local' then
return
end
-- 参数/call禁止反向查找赋值
diff --git a/test/crossfile/allreferences.lua b/test/crossfile/allreferences.lua
index bddc159d..6c7febeb 100644
--- a/test/crossfile/allreferences.lua
+++ b/test/crossfile/allreferences.lua
@@ -1,3 +1,4 @@
+local config = require 'config'
TEST {
{
@@ -67,6 +68,7 @@ TEST {
},
}
+config.set('Lua.IntelliSense.traceBeSetted', true)
TEST {
{
path = 'a.lua',
@@ -213,3 +215,5 @@ TEST {
]]
},
}
+config.set('Lua.IntelliSense.traceBeSetted', false)
+
diff --git a/test/rename/init.lua b/test/rename/init.lua
index 01abe167..774c86d2 100644
--- a/test/rename/init.lua
+++ b/test/rename/init.lua
@@ -2,6 +2,7 @@ local core = require 'core.rename'
local files = require 'files'
local catch = require 'catch'
local guide = require 'parser.guide'
+local config = require 'config'
local function replace(text, positions)
local state = files.getState('')
@@ -89,6 +90,7 @@ local function f(b)
end
]]
+config.set('Lua.IntelliSense.traceBeSetted', true)
TEST ('a', '!!!') [[
t = {
a = 0
@@ -116,6 +118,7 @@ t = {
t["!!!"] = 1
a = t["!!!"]
]]
+config.set('Lua.IntelliSense.traceBeSetted', false)
TEST ('a', '"') [[
print(t[ "a" ])