Registering reference providers for Twig tokens in PHPStorm

Hey,

I try to register a reference provider for a TwigTokenTypes.STRING_TEXT, using the registrar in the contributor. Unfortunatly this leads not the call of the provider while ctrlclick or ctrlhovering it.

I tried a simple matching condition:

 psiElementCapture = PlatformPatterns.psiElement(TwigTokenTypes.STRING_TEXT);]]>


And I tried a more complex condition:

 psiElementCapture = PlatformPatterns.psiElement(
                TwigTokenTypes.STRING_TEXT)
                .afterSiblingSkipping(
                        PlatformPatterns.or(
                                PlatformPatterns.psiElement(TwigTokenTypes.SINGLE_QUOTE),
                                PlatformPatterns.psiElement(TwigTokenTypes.DOUBLE_QUOTE)),

                        PlatformPatterns.psiElement(TwigTokenTypes.LBRACE)
                        .afterSibling(
                                PlatformPatterns.psiElement(TwigTokenTypes.IDENTIFIER)
                                        .withText(StandardPatterns.string().equalTo("path"))
                        )

                );]]>


Both do not match in any way.

---
Original message URL: http://devnet.jetbrains.net/message/5461010#5461010

Please sign in to leave a comment.