diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml
index ad27f1d53d3..6d0d3331f2f 100644
--- a/idea/src/META-INF/plugin.xml
+++ b/idea/src/META-INF/plugin.xml
@@ -172,6 +172,7 @@
+
diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/KotlinSignatureInJavaMarkerProvider.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/KotlinSignatureInJavaMarkerProvider.java
new file mode 100644
index 00000000000..b28090417cd
--- /dev/null
+++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/KotlinSignatureInJavaMarkerProvider.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2010-2012 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jetbrains.jet.plugin.codeInsight;
+
+import com.intellij.codeHighlighting.Pass;
+import com.intellij.codeInsight.daemon.GutterIconNavigationHandler;
+import com.intellij.codeInsight.daemon.LineMarkerInfo;
+import com.intellij.codeInsight.daemon.LineMarkerProvider;
+import com.intellij.psi.*;
+import com.intellij.util.Function;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
+import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames;
+import org.jetbrains.jet.plugin.JetIcons;
+
+import java.awt.event.MouseEvent;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Evgeny Gerashchenko
+ * @since 3 August 2012
+ */
+public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
+ private static final Function TOOLTIP_PROVIDER = new Function() {
+ @Override
+ public String fun(PsiElement element) {
+ PsiAnnotation annotation = findKotlinSignatureAnnotation(element);
+ assert annotation != null;
+ PsiAnnotationMemberValue value = annotation.getParameterList().getAttributes()[0].getValue();
+ String signature = value == null ? "null" : value instanceof PsiLiteralExpression
+ ? ((PsiLiteralExpression) value).getValue().toString()
+ : value.getText();
+ return "Alternative Kotlin signature is available for this method:\n"
+ + signature;
+ }
+ };
+ private static final GutterIconNavigationHandler NAVIGATION_HANDLER = new GutterIconNavigationHandler() {
+ @Override
+ public void navigate(MouseEvent e, PsiMethod elt) {
+ }
+ };
+
+ @Nullable
+ private static PsiAnnotation findKotlinSignatureAnnotation(@NotNull PsiElement element) {
+ if (!(element instanceof PsiMethod)) return null;
+ PsiMethod annotationOwner = element.getOriginalElement() instanceof PsiMethod
+ ? (PsiMethod) element.getOriginalElement()
+ : (PsiMethod) element;
+ PsiAnnotation annotation =
+ JavaDescriptorResolver.findAnnotation(annotationOwner, JvmStdlibNames.KOTLIN_SIGNATURE.getFqName().getFqName());
+ if (annotation == null) return null;
+ if (annotation.getParameterList().getAttributes().length == 0) return null;
+ return annotation;
+ }
+
+ @Override
+ @Nullable
+ public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
+ if (findKotlinSignatureAnnotation(element) != null) {
+ return new LineMarkerInfo((PsiMethod) element, element.getTextOffset(), JetIcons.SMALL_LOGO, Pass.UPDATE_ALL,
+ TOOLTIP_PROVIDER, NAVIGATION_HANDLER);
+ }
+ return null;
+ }
+
+ @Override
+ public void collectSlowLineMarkers(@NotNull List elements, @NotNull Collection result) {
+ }
+}