Skip to content

Commit 951fb08

Browse files
committed
fix goto type definition
1 parent a37234b commit 951fb08

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 3.0.2
44
* `FIX` `table<string, boolean>[string] -> boolean`
5+
* `FIX` goto `type definition`
56
* `FIX` [#1050](https://github.com/sumneko/lua-language-server/issues/1050)
67

78
## 3.0.1

script/core/type-definition.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,18 @@ return function (uri, offset)
139139
goto CONTINUE
140140
end
141141
src = src.field or src.method or src.index or src
142+
if src.type == 'doc.class' then
143+
src = src.class
144+
end
145+
if src.type == 'doc.alias' then
146+
src = src.alias
147+
end
142148
if src.type == 'doc.class.name'
143149
or src.type == 'doc.alias.name'
144150
or src.type == 'doc.type.function'
145151
or src.type == 'doc.type.array'
146152
or src.type == 'doc.type.table'
147-
or src.type == 'doc.type.ltable' then
153+
or src.type == 'function' then
148154
results[#results+1] = {
149155
target = src,
150156
uri = root.uri,

0 commit comments

Comments
 (0)