Fix navigation on stdlib in non-gradle projects (KT-28398)
In non-gradle project kotlin-stdlib-sources.jar contains sources for common and jvm part, so both (expect and actual) declarations are present in the same library sources scope. We are moving expect declarations in the bottom of this list to avoid navigation on expect declaration when actual declaration is present in the same scope ^KT-28398 Fixed
This commit is contained in:
+2
-1
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.idea.stubindex.KotlinTopLevelFunctionFqnNameIndex
|
||||
import org.jetbrains.kotlin.idea.stubindex.KotlinTopLevelPropertyFqnNameIndex
|
||||
import org.jetbrains.kotlin.idea.stubindex.KotlinTopLevelTypeAliasFqNameIndex
|
||||
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil
|
||||
import org.jetbrains.kotlin.idea.util.isExpectDeclaration
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
@@ -211,7 +212,7 @@ object SourceNavigationHelper {
|
||||
}
|
||||
|
||||
return scopes.flatMap { scope ->
|
||||
index.get(declaration.fqName!!.asString(), declaration.project, scope)
|
||||
index.get(declaration.fqName!!.asString(), declaration.project, scope).sortedBy { it.isExpectDeclaration() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user