use of com.intellij.codeInsight.daemon.LineMarkerInfo in project intellij-plugins by JetBrains.
the class DartServerImplementationsMarkerProvider method createMarkerClass.
@NotNull
private static LineMarkerInfo createMarkerClass(@NotNull final DartComponentName name) {
final VirtualFile file = name.getContainingFile().getVirtualFile();
final int nameOffset = name.getTextRange().getStartOffset();
return new LineMarkerInfo<>(name, name.getTextRange(), AllIcons.Gutter.OverridenMethod, Pass.LINE_MARKERS, element -> DaemonBundle.message("class.is.subclassed.too.many"), (GutterIconNavigationHandler<PsiElement>) (e, elt) -> {
final List<TypeHierarchyItem> items = DartAnalysisServerService.getInstance(name.getProject()).search_getTypeHierarchy(file, nameOffset, false);
if (items.isEmpty()) {
return;
}
final List<DartComponent> components = DartInheritorsSearcher.getSubClasses(name.getProject(), GlobalSearchScope.allScope(name.getProject()), items);
PsiElementListNavigator.openTargets(e, DartResolveUtil.getComponentNameArray(components), DaemonBundle.message("navigation.title.subclass", name.getName(), components.size(), ""), "Subclasses of " + name.getName(), new DefaultPsiElementCellRenderer());
}, GutterIconRenderer.Alignment.RIGHT);
}
use of com.intellij.codeInsight.daemon.LineMarkerInfo in project intellij-plugins by JetBrains.
the class FlashUIDesignerLineMarkerProvider method getLineMarkerInfo.
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
if (!(element instanceof XmlTag)) {
return null;
}
final XmlTag tag = (XmlTag) element;
final XmlFile psiFile = (XmlFile) tag.getContainingFile();
if (psiFile.getRootTag() != tag || !DesignerApplicationManager.isApplicable(tag.getProject(), psiFile)) {
return null;
}
//holder.createInfoAnnotation(textRange, null).setGutterIconRenderer(new MyRenderer());
return new LineMarkerInfo<>(element, element.getTextRange(), PlatformIcons.UI_FORM_ICON, Pass.LINE_MARKERS, element1 -> FlashUIDesignerBundle.message("gutter.open"), new GutterIconNavigationHandler<PsiElement>() {
@Override
public void navigate(MouseEvent e, PsiElement elt) {
DesignerApplicationManager.getInstance().openDocument(psiFile, false);
}
}, GutterIconRenderer.Alignment.LEFT);
}
use of com.intellij.codeInsight.daemon.LineMarkerInfo in project android by JetBrains.
the class AndroidGotoRelatedTest method doGetRelatedLineMarkers.
private List<LineMarkerInfo> doGetRelatedLineMarkers() {
myFixture.doHighlighting();
final List<LineMarkerInfo> markers = DaemonCodeAnalyzerImpl.getLineMarkers(myFixture.getEditor().getDocument(), myFixture.getProject());
final List<LineMarkerInfo> relatedMarkers = new ArrayList<>();
for (LineMarkerInfo marker : markers) {
if (marker.getNavigationHandler() instanceof AndroidLineMarkerProvider.MyNavigationHandler) {
relatedMarkers.add(marker);
}
}
return relatedMarkers;
}
use of com.intellij.codeInsight.daemon.LineMarkerInfo in project android by JetBrains.
the class AndroidGotoRelatedTest method testSimpleClassToLayout.
public void testSimpleClassToLayout() throws Exception {
createManifest();
myFixture.copyFileToProject(BASE_PATH + "layout1.xml", "res/layout/layout.xml");
final VirtualFile file = myFixture.copyFileToProject(BASE_PATH + "Class1.java", "src/p1/p2/Class1.java");
doTestGotoRelatedFile(file, Collections.<VirtualFile>emptyList(), PsiFile.class);
final List<LineMarkerInfo> markerInfos = doGetRelatedLineMarkers();
assertEmpty(markerInfos);
}
use of com.intellij.codeInsight.daemon.LineMarkerInfo in project intellij-community by JetBrains.
the class ExpectedHighlightingData method refreshLineMarkers.
private void refreshLineMarkers() {
for (Map.Entry<RangeMarker, LineMarkerInfo> entry : myLineMarkerInfos.entrySet()) {
RangeMarker rangeMarker = entry.getKey();
int startOffset = rangeMarker.getStartOffset();
int endOffset = rangeMarker.getEndOffset();
LineMarkerInfo value = entry.getValue();
PsiElement element = value.getElement();
assert element != null : value;
TextRange range = new TextRange(startOffset, endOffset);
final String tooltip = value.getLineMarkerTooltip();
LineMarkerInfo markerInfo = new LineMarkerInfo<>(element, range, null, value.updatePass, e -> tooltip, null, GutterIconRenderer.Alignment.RIGHT);
entry.setValue(markerInfo);
}
}
Aggregations