Search in sources :

Example 1 with AnalysisCanceledException

use of com.intellij.psi.controlFlow.AnalysisCanceledException in project ballerina by ballerina-lang.

the class HighlightExitPointsHandler method computeUsages.

@Override
public void computeUsages(final List<PsiElement> targets) {
    PsiElement parent = PsiTreeUtil.getParentOfType(myTarget, StatementNode.class);
    if (!(parent instanceof ReturnStatementNode) && !(parent instanceof ThrowStatementNode)) {
        return;
    }
    final PsiElement definitionNode = PsiTreeUtil.getParentOfType(parent, FunctionDefinitionNode.class, ResourceDefinitionNode.class, ActionDefinitionNode.class);
    if (definitionNode == null) {
        return;
    }
    try {
        highlightExitPoints(definitionNode);
    } catch (AnalysisCanceledException e) {
    // ignore
    }
}
Also used : ReturnStatementNode(org.ballerinalang.plugins.idea.psi.ReturnStatementNode) ThrowStatementNode(org.ballerinalang.plugins.idea.psi.ThrowStatementNode) PsiElement(com.intellij.psi.PsiElement) AnalysisCanceledException(com.intellij.psi.controlFlow.AnalysisCanceledException)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 AnalysisCanceledException (com.intellij.psi.controlFlow.AnalysisCanceledException)1 ReturnStatementNode (org.ballerinalang.plugins.idea.psi.ReturnStatementNode)1 ThrowStatementNode (org.ballerinalang.plugins.idea.psi.ThrowStatementNode)1