Move: Improved file chooser with search

#KT-9752 Fixed
This commit is contained in:
Alexey Sedunov
2016-01-25 16:21:54 +03:00
parent 625bfe12eb
commit 58963f7053
5 changed files with 104 additions and 15 deletions
@@ -35,9 +35,11 @@ fun Project.projectScope(): GlobalSearchScope = GlobalSearchScope.projectScope(t
fun PsiFile.fileScope(): GlobalSearchScope = GlobalSearchScope.fileScope(this)
fun GlobalSearchScope.restrictToKotlinSources() = GlobalSearchScope.getScopeRestrictedByFileTypes(this, KotlinFileType.INSTANCE)
fun SearchScope.restrictToKotlinSources(): SearchScope {
return when (this) {
is GlobalSearchScope -> GlobalSearchScope.getScopeRestrictedByFileTypes(this, KotlinFileType.INSTANCE)
is GlobalSearchScope -> restrictToKotlinSources()
is LocalSearchScope -> {
val ktElements = scope.filter { it.containingFile is KtFile }
when (ktElements.size) {