summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/type-definition.lua8
2 files changed, 8 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 3831558b..05d233d8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,7 @@
## 3.0.2
* `FIX` `table<string, boolean>[string] -> boolean`
+* `FIX` goto `type definition`
* `FIX` [#1050](https://github.com/sumneko/lua-language-server/issues/1050)
## 3.0.1
diff --git a/script/core/type-definition.lua b/script/core/type-definition.lua
index e045f9b2..92f81997 100644
--- a/script/core/type-definition.lua
+++ b/script/core/type-definition.lua
@@ -139,12 +139,18 @@ return function (uri, offset)
goto CONTINUE
end
src = src.field or src.method or src.index or src
+ if src.type == 'doc.class' then
+ src = src.class
+ end
+ if src.type == 'doc.alias' then
+ src = src.alias
+ end
if src.type == 'doc.class.name'
or src.type == 'doc.alias.name'
or src.type == 'doc.type.function'
or src.type == 'doc.type.array'
or src.type == 'doc.type.table'
- or src.type == 'doc.type.ltable' then
+ or src.type == 'function' then
results[#results+1] = {
target = src,
uri = root.uri,