KT-62695 [AA] Implement resolution of extension functions in KDoc

The solution is not complete, since resolution of KDocs is not
fully specified and is rather tricky.
Many more corner cases are to be expected.
This solution should at least give some groundwork for the future
improvements/fixes of the resolver.

^KT-62695 Fixed
This commit is contained in:
Roman Golyshev
2024-01-23 00:16:08 +01:00
committed by Space Team
parent 42753c461f
commit 2befd2bffb
10 changed files with 171 additions and 40 deletions
@@ -7,7 +7,9 @@ Caret 2 resolved to:
1: (in test) val test.Foo.ext: kotlin.Int
Caret 3 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Foo.ext()
1: (in test) val test.Foo.ext: kotlin.Int
Caret 4 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Foo.ext()
1: (in test) val test.Foo.ext: kotlin.Int
@@ -1,5 +1,5 @@
Caret 1 resolved to:
Nothing (Unresolved reference)
0: (in test.Base) fun test.Receiver.ext()
Caret 2 resolved to:
Nothing (Unresolved reference)
0: (in test.Base) fun test.Receiver.ext()
@@ -7,7 +7,10 @@ Caret 2 resolved to:
1: (in test) fun test.Base.function(i: kotlin.Int)
Caret 3 resolved to:
0: (in test.Base) fun function()
0: (in test) fun kotlin.Any.function()
1: (in test) fun test.Base.function(i: kotlin.Int)
2: (in test.Base) fun function()
Caret 4 resolved to:
0: (in test.Base) fun function()
0: (in test) fun kotlin.Any.function()
1: (in test) fun test.Base.function(i: kotlin.Int)
@@ -1,20 +1,20 @@
Caret 1 resolved to:
Nothing (Unresolved reference)
0: (in test) fun <T> T.anyExt()
Caret 2 resolved to:
Nothing (Unresolved reference)
0: (in test) fun <T> T.anyExt()
Caret 3 resolved to:
Nothing (Unresolved reference)
0: (in test) fun <T> T.anyExt()
Caret 4 resolved to:
Nothing (Unresolved reference)
Caret 5 resolved to:
Nothing (Unresolved reference)
0: (in test) fun <T : test.Base> T.baseExt()
Caret 6 resolved to:
Nothing (Unresolved reference)
0: (in test) fun <T : test.Base> T.baseExt()
Caret 7 resolved to:
Nothing (Unresolved reference)
@@ -23,4 +23,4 @@ Caret 8 resolved to:
Nothing (Unresolved reference)
Caret 9 resolved to:
Nothing (Unresolved reference)
0: (in test) fun <T : test.Child> T.childExt()
@@ -1,5 +1,5 @@
Caret 1 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.WithGenerics<kotlin.Int>.intExt()
Caret 2 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.WithGenerics<kotlin.String>.stringExt()
@@ -5,7 +5,7 @@ Caret 2 resolved to:
0: (in test) fun test.Foo.extFun()
Caret 3 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Foo.extFun()
Caret 4 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Foo.extFun()
@@ -5,7 +5,7 @@ Caret 2 resolved to:
0: (in test) val test.Foo.extProp: kotlin.Int
Caret 3 resolved to:
Nothing (Unresolved reference)
0: (in test) val test.Foo.extProp: kotlin.Int
Caret 4 resolved to:
Nothing (Unresolved reference)
0: (in test) val test.Foo.extProp: kotlin.Int
@@ -1,14 +1,14 @@
Caret 1 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Foo.fooExt()
Caret 2 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.FooAlias.fooAliasExt()
Caret 3 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.FooAlias.fooAliasExt()
Caret 4 resolved to:
Nothing (Unresolved reference)
0: (in test) fun kotlin.Any.anyExt()
Caret 5 resolved to:
Nothing (Unresolved reference)
@@ -1,20 +1,20 @@
Caret 1 resolved to:
Nothing (Unresolved reference)
0: (in test) fun kotlin.Any.anyExt()
Caret 2 resolved to:
Nothing (Unresolved reference)
0: (in test) fun kotlin.Any.anyExt()
Caret 3 resolved to:
Nothing (Unresolved reference)
0: (in test) fun kotlin.Any.anyExt()
Caret 4 resolved to:
Nothing (Unresolved reference)
Caret 5 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Base.baseExt()
Caret 6 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Base.baseExt()
Caret 7 resolved to:
Nothing (Unresolved reference)
@@ -23,4 +23,4 @@ Caret 8 resolved to:
Nothing (Unresolved reference)
Caret 9 resolved to:
Nothing (Unresolved reference)
0: (in test) fun test.Child.childExt()