summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md2
-rw-r--r--script/vm/ref.lua43
-rw-r--r--test/references/all.lua13
3 files changed, 36 insertions, 22 deletions
diff --git a/changelog.md b/changelog.md
index 654e4de0..a562d717 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,8 +2,10 @@
## 3.6.14
* `FIX` [#1753]
+* `FIX` [#1914]
[#1753]: https://github.com/LuaLS/lua-language-server/issues/1753
+[#1914]: https://github.com/LuaLS/lua-language-server/issues/1914
## 3.6.13
`2023-3-2`
diff --git a/script/vm/ref.lua b/script/vm/ref.lua
index 9c248684..89b9d3c0 100644
--- a/script/vm/ref.lua
+++ b/script/vm/ref.lua
@@ -107,29 +107,28 @@ local function searchWord(source, pushResult, defMap, fileNotify)
await.delay()
end
end)
- else
- ---@async
- guide.eachSourceTypes(state.ast, {'getfield', 'setfield'}, function (src)
- if src.field and src.field[1] == key then
- checkDef(src)
- await.delay()
- end
- end)
- ---@async
- guide.eachSourceTypes(state.ast, {'getmethod', 'setmethod'}, function (src)
- if src.method and src.method[1] == key then
- checkDef(src)
- await.delay()
- end
- end)
- ---@async
- guide.eachSourceTypes(state.ast, {'getindex', 'setindex'}, function (src)
- if src.index and src.index.type == 'string' and src.index[1] == key then
- checkDef(src)
- await.delay()
- end
- end)
end
+ ---@async
+ guide.eachSourceTypes(state.ast, {'getfield', 'setfield'}, function (src)
+ if src.field and src.field[1] == key then
+ checkDef(src)
+ await.delay()
+ end
+ end)
+ ---@async
+ guide.eachSourceTypes(state.ast, {'getmethod', 'setmethod'}, function (src)
+ if src.method and src.method[1] == key then
+ checkDef(src)
+ await.delay()
+ end
+ end)
+ ---@async
+ guide.eachSourceTypes(state.ast, {'getindex', 'setindex'}, function (src)
+ if src.index and src.index.type == 'string' and src.index[1] == key then
+ checkDef(src)
+ await.delay()
+ end
+ end)
end
searchInAllFiles(guide.getUri(source), findWord, fileNotify)
diff --git a/test/references/all.lua b/test/references/all.lua
index 9395df86..3c376c21 100644
--- a/test/references/all.lua
+++ b/test/references/all.lua
@@ -126,3 +126,16 @@ end
local v1 = Master:foobar("", Dog)
v1.<!eat!>()
]]
+
+TEST [[
+---@class A
+A = {}
+
+function A:<~TestA~>()
+end
+
+---@param param A
+function TestB(param)
+ param:<!TestA!>()
+end
+]]