Skip to content

Commit

Permalink
Only include CallDefinitionClauses in parameter info
Browse files Browse the repository at this point in the history
Ensures that references to imports and uses aren't shown
  • Loading branch information
KronicDeth committed Oct 14, 2019
1 parent 6562851 commit cb21f94
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/org/elixir_lang/code_insight/ParameterInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@ class ParameterInfo : ParameterInfoHandler<Arguments, Any> {
val itemToShowList = call.references.flatMap { reference ->
if (reference is PsiPolyVariantReference) {
reference.multiResolve(true).flatMap { resolveResult ->
resolveResult.element?.let { singletonList(it) } ?: emptyList()
resolveResult.element?.let {
if ((it is Call) && CallDefinitionClause.`is`(it)) {
singletonList(it)
} else {
null
}
} ?: emptyList()
}
} else {
reference.resolve()?.let { resolvedElement ->
singletonList(resolvedElement)
if ((resolvedElement is Call) && CallDefinitionClause.`is`(resolvedElement)) {
singletonList(resolvedElement)
} else {
null
}
} ?: emptyList<Any>()
}
}
Expand Down

0 comments on commit cb21f94

Please sign in to comment.