[NI] Fix exception from IDE completion
Fake arguments that are created for completion might have missing PSI parts (see `DummyArgument`)
This commit is contained in:
+1
-2
@@ -124,8 +124,7 @@ class DiagnosticReporterByTrackingStrategy(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCallArgumentName(callArgument: KotlinCallArgument, diagnostic: KotlinCallDiagnostic) {
|
override fun onCallArgumentName(callArgument: KotlinCallArgument, diagnostic: KotlinCallDiagnostic) {
|
||||||
val nameReference = callArgument.psiCallArgument.valueArgument.getArgumentName()?.referenceExpression
|
val nameReference = callArgument.psiCallArgument.valueArgument.getArgumentName()?.referenceExpression ?: return
|
||||||
?: error("Argument name should be not null for argument: $callArgument")
|
|
||||||
when (diagnostic.javaClass) {
|
when (diagnostic.javaClass) {
|
||||||
NamedArgumentReference::class.java -> {
|
NamedArgumentReference::class.java -> {
|
||||||
trace.record(BindingContext.REFERENCE_TARGET, nameReference, (diagnostic as NamedArgumentReference).parameterDescriptor)
|
trace.record(BindingContext.REFERENCE_TARGET, nameReference, (diagnostic as NamedArgumentReference).parameterDescriptor)
|
||||||
|
|||||||
Reference in New Issue
Block a user