Search in sources :

Example 1 with RouteReference

use of com.cedricziel.idea.typo3.routing.RouteReference in project idea-php-typo3-plugin by cedricziel.

the class RouteAnnotator method annotate.

@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder annotationHolder) {
    if (!(psiElement instanceof StringLiteralExpression)) {
        return;
    }
    StringLiteralExpression literalExpression = (StringLiteralExpression) psiElement;
    String value = literalExpression.getContents();
    if (value.isEmpty()) {
        return;
    }
    for (PsiReference psiReference : literalExpression.getReferences()) {
        if (psiReference instanceof RouteReference) {
            annotateRoute(psiElement, annotationHolder, value);
        }
    }
}
Also used : RouteReference(com.cedricziel.idea.typo3.routing.RouteReference) StringLiteralExpression(com.jetbrains.php.lang.psi.elements.StringLiteralExpression) PsiReference(com.intellij.psi.PsiReference)

Aggregations

RouteReference (com.cedricziel.idea.typo3.routing.RouteReference)1 PsiReference (com.intellij.psi.PsiReference)1 StringLiteralExpression (com.jetbrains.php.lang.psi.elements.StringLiteralExpression)1