mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WI-21234 (NPE fixed, method argument annotated)
This commit is contained in:
@@ -20,19 +20,21 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.rest.psi.RestReference;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
* @author catherine
|
||||
*/
|
||||
public class RestGotoProvider extends GotoDeclarationHandlerBase {
|
||||
|
||||
public PsiElement getGotoDeclarationTarget(PsiElement source, Editor editor) {
|
||||
@Override
|
||||
public PsiElement getGotoDeclarationTarget(@Nullable PsiElement source, Editor editor) {
|
||||
if (source != null && source.getLanguage() instanceof RestLanguage) {
|
||||
RestReference ref = PsiTreeUtil.getParentOfType(source, RestReference.class);
|
||||
if (ref != null) {
|
||||
return ref.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user