Search in sources :

Example 1 with OverriddenMember

use of org.dartlang.analysis.server.protocol.OverriddenMember in project intellij-plugins by JetBrains.

the class DartServerOverrideMarkerProvider method createOverrideMarker.

@Nullable
private static LineMarkerInfo createOverrideMarker(DartComponentName componentName) {
    final VirtualFile virtualFile = componentName.getContainingFile().getVirtualFile();
    if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
        return null;
    }
    final List<DartServerData.DartOverrideMember> overrideMembers = DartAnalysisServerService.getInstance(componentName.getProject()).getOverrideMembers(virtualFile);
    final Project project = componentName.getProject();
    final int nameOffset = componentName.getTextRange().getStartOffset();
    DartComponent superclassComponent = null;
    List<DartComponent> interfaceComponents = Lists.newArrayList();
    for (DartServerData.DartOverrideMember overrideMember : overrideMembers) {
        if (overrideMember.getOffset() == nameOffset) {
            final OverriddenMember member = overrideMember.getSuperclassMember();
            superclassComponent = member == null ? null : DartHierarchyUtil.findDartComponent(project, member.getElement().getLocation());
            if (overrideMember.getInterfaceMembers() != null) {
                for (OverriddenMember overriddenMember : overrideMember.getInterfaceMembers()) {
                    addDartComponent(interfaceComponents, project, overriddenMember);
                }
            }
        }
    }
    return tryCreateOverrideMarker(componentName, superclassComponent, interfaceComponents);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) DartComponent(com.jetbrains.lang.dart.psi.DartComponent) DartServerData(com.jetbrains.lang.dart.analyzer.DartServerData) OverriddenMember(org.dartlang.analysis.server.protocol.OverriddenMember) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 DartServerData (com.jetbrains.lang.dart.analyzer.DartServerData)1 DartComponent (com.jetbrains.lang.dart.psi.DartComponent)1 OverriddenMember (org.dartlang.analysis.server.protocol.OverriddenMember)1 Nullable (org.jetbrains.annotations.Nullable)1