KTIJ-26713 [AA] Clean-up KtFirReferenceShortener

- revert some accidental changes in
`findSmallestElementOfTypeContainingSelection` function (see 48433bf9)
- simplify `dropFakeRootPrefixIfPresent` by using `tail`, add a new
test-case to check that it works
- simplify `findClassifierElementsToShorten` by not passing lambdas and
calling a common functions instead
This commit is contained in:
Roman Golyshev
2023-08-20 15:24:47 +02:00
committed by teamcity
parent 24a13348c4
commit b760046f93
5 changed files with 72 additions and 38 deletions
@@ -0,0 +1,14 @@
// FILE: main.kt
import dependency.Foo
/**
* [<expr>_root_ide_package_.dependency.Foo</expr>.foo]
*/
fun test() {}
// FILE: dependency.kt
package dependency
object Foo {
fun foo() {}
}
@@ -0,0 +1,9 @@
Before shortening: _root_ide_package_.dependency.Foo
with DO_NOT_SHORTEN:
[kdoc] _root_ide_package_.dependency
with SHORTEN_IF_ALREADY_IMPORTED:
[kdoc] _root_ide_package_.dependency.Foo
with SHORTEN_AND_IMPORT:
[kdoc] _root_ide_package_.dependency.Foo
with SHORTEN_AND_STAR_IMPORT:
[kdoc] _root_ide_package_.dependency.Foo