mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
OC-11478 Navigate to super and overriding methods in Swift (after review)
This commit is contained in:
@@ -27,6 +27,7 @@ import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -120,7 +121,7 @@ public abstract class MergeableLineMarkerInfo<T extends PsiElement> extends Line
|
||||
}
|
||||
});
|
||||
final JBList list = new JBList(infos);
|
||||
list.setFixedCellHeight(20);
|
||||
list.setFixedCellHeight(UIUtil.LIST_FIXED_CELL_HEIGHT);
|
||||
PopupChooserBuilder builder = JBPopupFactory.getInstance().createListPopupBuilder(list);
|
||||
if (!markers.get(0).configurePopupAndRenderer(builder, list, infos)) {
|
||||
list.installCellRenderer(new NotNullFunction<Object, JComponent>() {
|
||||
|
||||
@@ -279,7 +279,9 @@ goto.test.findUsages.subject.title=Test Subjects for {0}
|
||||
goto.test.notFound=No test subjects found
|
||||
|
||||
incremental.search.tooltip.prefix=Search for:
|
||||
goto.super.field.chooser.title=Choose super field
|
||||
goto.super.method.chooser.title=Choose super method
|
||||
goto.super.method.of.chooser.title=Choose Super Method of {0}
|
||||
goto.super.method.findUsages.title=Super methods of {0}
|
||||
goto.super.class.chooser.title=Choose super class or interface
|
||||
javadoc.action.back=Back
|
||||
|
||||
+3
@@ -439,6 +439,9 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture {
|
||||
@Nullable
|
||||
GutterMark findGutter(@NotNull @TestDataFile @NonNls String filePath);
|
||||
|
||||
@NotNull
|
||||
Collection<GutterMark> findCaretGutters();
|
||||
|
||||
@NotNull
|
||||
PsiManager getPsiManager();
|
||||
|
||||
|
||||
+18
-5
@@ -923,14 +923,28 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
@Nullable
|
||||
public GutterMark findGutter(@NotNull final String filePath) {
|
||||
configureByFilesInner(filePath);
|
||||
CommonProcessors.FindFirstProcessor<GutterMark> processor = new CommonProcessors.FindFirstProcessor<GutterMark>();
|
||||
findGutters(processor);
|
||||
return processor.getFoundValue();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<GutterMark> findCaretGutters() {
|
||||
CommonProcessors.CollectProcessor<GutterMark> processor = new CommonProcessors.CollectProcessor<GutterMark>();
|
||||
findGutters(processor);
|
||||
return processor.getResults();
|
||||
}
|
||||
|
||||
private void findGutters(Processor<GutterMark> processor) {
|
||||
int offset = myEditor.getCaretModel().getOffset();
|
||||
|
||||
final Collection<HighlightInfo> infos = doHighlighting();
|
||||
for (HighlightInfo info : infos) {
|
||||
if (info.endOffset >= offset && info.startOffset <= offset) {
|
||||
final GutterMark renderer = info.getGutterIconRenderer();
|
||||
if (renderer != null) {
|
||||
return renderer;
|
||||
if (renderer != null && !processor.process(renderer)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -938,12 +952,11 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
for (RangeHighlighter highlighter : highlighters) {
|
||||
if (highlighter.getEndOffset() >= offset && highlighter.getStartOffset() <= offset) {
|
||||
GutterMark renderer = highlighter.getGutterIconRenderer();
|
||||
if (renderer != null) {
|
||||
return renderer;
|
||||
if (renderer != null && !processor.process(renderer)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2633,6 +2633,7 @@ public class UIUtil {
|
||||
return SystemInfo.isMac && isUnderAquaLookAndFeel() ? 28 : height;
|
||||
}
|
||||
|
||||
public static final int LIST_FIXED_CELL_HEIGHT = 20;
|
||||
|
||||
/**
|
||||
* The main difference from javax.swing.SwingUtilities#isDescendingFrom(Component, Component) is that this method
|
||||
|
||||
Reference in New Issue
Block a user