Minor: fix weak warnings and formatting in KotlinReferencesSearcher.kt
This commit is contained in:
+11
-11
@@ -60,13 +60,13 @@ data class KotlinReferencesSearchOptions(val acceptCallableOverrides: Boolean =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class KotlinReferencesSearchParameters(elementToSearch: PsiElement,
|
class KotlinReferencesSearchParameters(
|
||||||
scope: SearchScope = runReadAction { elementToSearch.project.allScope() },
|
elementToSearch: PsiElement,
|
||||||
ignoreAccessScope: Boolean = false,
|
scope: SearchScope = runReadAction { elementToSearch.project.allScope() },
|
||||||
optimizer: SearchRequestCollector? = null,
|
ignoreAccessScope: Boolean = false,
|
||||||
val kotlinOptions: KotlinReferencesSearchOptions = KotlinReferencesSearchOptions.Empty)
|
optimizer: SearchRequestCollector? = null,
|
||||||
: ReferencesSearch.SearchParameters(elementToSearch, scope, ignoreAccessScope, optimizer) {
|
val kotlinOptions: KotlinReferencesSearchOptions = KotlinReferencesSearchOptions.Empty)
|
||||||
}
|
: ReferencesSearch.SearchParameters(elementToSearch, scope, ignoreAccessScope, optimizer)
|
||||||
|
|
||||||
class KotlinReferencesSearcher : QueryExecutorBase<PsiReference, ReferencesSearch.SearchParameters>() {
|
class KotlinReferencesSearcher : QueryExecutorBase<PsiReference, ReferencesSearch.SearchParameters>() {
|
||||||
override fun processQuery(queryParameters: ReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
|
override fun processQuery(queryParameters: ReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
|
||||||
@@ -105,9 +105,9 @@ class KotlinReferencesSearcher : QueryExecutorBase<PsiReference, ReferencesSearc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val refFilter: (PsiReference) -> Boolean = when {
|
val refFilter: (PsiReference) -> Boolean = when (unwrappedElement) {
|
||||||
unwrappedElement is KtParameter -> ({ ref: PsiReference -> !ref.isNamedArgumentReference()/* they are processed later*/ })
|
is KtParameter -> ({ ref: PsiReference -> !ref.isNamedArgumentReference()/* they are processed later*/ })
|
||||||
else -> ({true})
|
else -> ({ true })
|
||||||
}
|
}
|
||||||
|
|
||||||
val resultProcessor = KotlinRequestResultProcessor(unwrappedElement, filter = refFilter, options = kotlinOptions)
|
val resultProcessor = KotlinRequestResultProcessor(unwrappedElement, filter = refFilter, options = kotlinOptions)
|
||||||
@@ -166,7 +166,7 @@ class KotlinReferencesSearcher : QueryExecutorBase<PsiReference, ReferencesSearc
|
|||||||
private fun searchNamedArguments(parameter: KtParameter) {
|
private fun searchNamedArguments(parameter: KtParameter) {
|
||||||
val parameterName = parameter.name ?: return
|
val parameterName = parameter.name ?: return
|
||||||
val function = parameter.ownerFunction as? KtFunction ?: return
|
val function = parameter.ownerFunction as? KtFunction ?: return
|
||||||
if (function.nameAsName?.isSpecial ?: true) return
|
if (function.nameAsName?.isSpecial != false) return
|
||||||
val project = function.project
|
val project = function.project
|
||||||
var namedArgsScope = function.useScope.intersectWith(queryParameters.scopeDeterminedByUser)
|
var namedArgsScope = function.useScope.intersectWith(queryParameters.scopeDeterminedByUser)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user