From 96c01b725fccc6195820e6f918a24737769cf256 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Sat, 25 Aug 2012 16:31:38 +0400 Subject: [PATCH] Enabled AddKotlinSignatureAnnotation action available for methods without body. --- .../codeInsight/AddKotlinSignatureAnnotation.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/AddKotlinSignatureAnnotation.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/AddKotlinSignatureAnnotation.java index d1fd53d728b..fde31e71bd6 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/AddKotlinSignatureAnnotation.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/AddKotlinSignatureAnnotation.java @@ -116,10 +116,12 @@ public class AddKotlinSignatureAnnotation extends BaseIntentionAction { //Not available in method's body PsiCodeBlock body = res.getBody(); - if (body == null) return null; - TextRange textRange = body.getTextRange(); - if (textRange == null || textRange.getStartOffset() <= offset) return null; - + if (body != null) { + TextRange bodyRange = body.getTextRange(); + if (bodyRange != null && bodyRange.getStartOffset() <= offset) { + return null; + } + } return res; } }