Search in sources :

Example 1 with DartArgumentList

use of com.jetbrains.lang.dart.psi.DartArgumentList in project intellij-plugins by JetBrains.

the class TestUtil method findGroupOrTestName.

@Nullable
public static String findGroupOrTestName(@Nullable final DartCallExpression expression) {
    String testName;
    final DartArguments arguments = expression == null ? null : expression.getArguments();
    final DartArgumentList dartArgumentList = arguments == null ? null : arguments.getArgumentList();
    if (dartArgumentList == null || dartArgumentList.getExpressionList().isEmpty()) {
        return null;
    }
    final DartExpression dartExpression = dartArgumentList.getExpressionList().get(0);
    testName = dartExpression == null ? "" : StringUtil.unquoteString(dartExpression.getText());
    return testName;
}
Also used : DartArgumentList(com.jetbrains.lang.dart.psi.DartArgumentList) DartArguments(com.jetbrains.lang.dart.psi.DartArguments) DartExpression(com.jetbrains.lang.dart.psi.DartExpression) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

DartArgumentList (com.jetbrains.lang.dart.psi.DartArgumentList)1 DartArguments (com.jetbrains.lang.dart.psi.DartArguments)1 DartExpression (com.jetbrains.lang.dart.psi.DartExpression)1 Nullable (org.jetbrains.annotations.Nullable)1