package com.intellij.codeInsight.navigation;

import com.intellij.JavaTestUtil;
import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
import com.intellij.codeInsight.daemon.LineMarkerInfo;
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl;
import com.intellij.lang.CodeInsightActions;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.editor.Document;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class JavaGotoSuperTest extends LightDaemonAnalyzerTestCase {
  @NotNull
  @Override
  protected String getTestDataPath() {
    return JavaTestUtil.getJavaTestDataPath();
  }

  protected String getBasePath() {
    return "/codeInsight/gotosuper/";
  }

  public void testLambda() throws Throwable {
    doTest();
  }

  public void testLambdaMarker() throws Exception {
    configureByFile(getBasePath() + getTestName(false) + ".java");
    int offset = myEditor.getCaretModel().getOffset();

    doHighlighting();
    Document document = getEditor().getDocument();
    List<LineMarkerInfo> markers = DaemonCodeAnalyzerImpl.getLineMarkers(document, getProject());
    for (LineMarkerInfo info : markers) {
      if (info.endOffset >= offset && info.startOffset <= offset) {
        assertEquals(
          "<html><body>Overrides method in <a href=\"#javaClass/I\">I</a><br><div style='margin-top: 5px'><font size='2'>Click or press Ctrl+U to navigate</font></div></body></html>",
          info.getLineMarkerTooltip());
        return;
      }
    }
    fail("Gutter expected");
  }

  private void doTest() throws Throwable {
    configureByFile(getBasePath() + getTestName(false) + ".java");
    final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(JavaLanguage.INSTANCE);
    handler.invoke(getProject(), getEditor(), getFile());
    checkResultByFile(getBasePath() + getTestName(false) + ".after.java");
  }
}

@@ -443,23 +443,177 @@
 api.
-editor.Document
+actionSystem.ActionManager;%0Aimport com.intellij.openapi.actionSystem.Shortcut;%0Aimport com.intellij.openapi.editor.Document;%0Aimport com.intellij.openapi.keymap.KeymapUtil
 ;%0Aim
@@ -1455,24 +1455,145 @@
 = offset) %7B%0A
+        Shortcut shortcut = ActionManager.getInstance().getAction(%22GotoSuperMethod%22).getShortcutSet().getShortcuts()%5B0%5D;%0A
         asse
@@ -1742,14 +1742,72 @@
 ess 
-Ctrl+U
+%22 +%0A          KeymapUtil.getShortcutText(shortcut) +%0A          %22
  to 

test fixed