FIR IDE: handle importing scopes in completion in HL API

Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com>
This commit is contained in:
Ilya Kirillov
2020-07-09 18:03:27 +03:00
parent 7aa26944d7
commit dee58e1d86
9 changed files with 191 additions and 15 deletions
@@ -0,0 +1,42 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.frontend.api.scopes
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
interface KtImportingScope : KtScope {
val imports: List<Import>
val isDefaultImportingScope: Boolean
}
interface KtStarImportingScope : KtImportingScope {
override val imports: List<StarImport>
}
interface KtNonStarImportingScope : KtImportingScope {
override val imports: List<NonStarImport>
}
sealed class Import {
abstract val packageFqName: FqName
abstract val relativeClassName: FqName?
abstract val resolvedClassId: ClassId?
}
class NonStarImport(
override val packageFqName: FqName,
override val relativeClassName: FqName?,
override val resolvedClassId: ClassId?,
val callableName: Name?,
) : Import()
class StarImport(
override val packageFqName: FqName,
override val relativeClassName: FqName?,
override val resolvedClassId: ClassId?,
) : Import()
@@ -10,6 +10,8 @@ import org.jetbrains.kotlin.idea.frontend.api.symbols.*
import org.jetbrains.kotlin.name.Name
interface KtScope : ValidityOwner {
// TODO check that names are accessible
// maybe return some kind of lazy set
fun getAllNames(): Set<Name>
fun getCallableNames(): Set<Name>
fun getClassLikeSymbolNames(): Set<Name>