Search in sources :

Example 6 with Location

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

the class DartHierarchyUtil method findDartClass.

@Nullable
public static DartClass findDartClass(@NotNull final Project project, @NotNull final TypeHierarchyItem item) {
    final Element classElement = item.getClassElement();
    final Location location = classElement.getLocation();
    final DartComponent component = findDartComponent(project, location);
    return component instanceof DartClass ? (DartClass) component : null;
}
Also used : Element(org.dartlang.analysis.server.protocol.Element) Location(org.dartlang.analysis.server.protocol.Location) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Location (org.dartlang.analysis.server.protocol.Location)6 PsiElement (com.intellij.psi.PsiElement)4 Element (org.dartlang.analysis.server.protocol.Element)4 DartComponent (com.jetbrains.lang.dart.psi.DartComponent)3 TypeHierarchyItem (org.dartlang.analysis.server.protocol.TypeHierarchyItem)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 JsonPrimitive (com.google.gson.JsonPrimitive)1 Project (com.intellij.openapi.project.Project)1 TextRange (com.intellij.openapi.util.TextRange)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 NavigatablePsiElement (com.intellij.psi.NavigatablePsiElement)1 PsiFile (com.intellij.psi.PsiFile)1 LocalSearchScope (com.intellij.psi.search.LocalSearchScope)1 SearchScope (com.intellij.psi.search.SearchScope)1 UsageInfo (com.intellij.usageView.UsageInfo)1 DartAnalysisServerService (com.jetbrains.lang.dart.analyzer.DartAnalysisServerService)1 List (java.util.List)1