GenericReference: unresolved not highlighting on XmlTokenType.XML_DATA_CHAR

I'm registering a ReferenceProvider on XmlTokenType.XML_DATA_CHARACTERS (with a few additional filters), everything works except for highlighting unresolved references. MyGenericReference#isSoft() returns false and returns null from resolveInner() when I cannot resolve correctly (PsiMethod otherwise). More or less exactly the same code works in XmlAttribute correctly, highlighting unresolved references.

Any thoughts? (#5745)

5 comments

still in 5766, can someone from JB shed some light on this?

the filter for reference:

0

You'd need to provide references for XmlTag

Yann Cebron wrote:

still in 5766, can someone from JB shed some light on this?


--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Maxim, where should I use XmlTag ?? returning enclosing XmlTag from GenericReference#getElement() did not help

my RP is supposed to be working inside characters within XmlTag-Body (XmlToken), see the following code


Thanks,
Yann

0

IDEA xml highlighting does not use references from xml tokens so you can:
- make your own annotator / highlight visitor
- your reference provider should provide references on xml tag, not on
data characters

Yann Cebron wrote:

Maxim, where should I use XmlTag ?? returning enclosing XmlTag from GenericReference#getElement() did not help

my RP is supposed to be working inside characters within XmlTag-Body (XmlToken), see the following code

  registry.registerReferenceProvider(
>         new AndFilter(
>             new ScopeFilter(
>                 new ParentElementFilter(
>                     new AndFilter(new ClassFilter(XmlTag.class),
>                                   NAMESPACE)
>                     , 2))
>             ,
>             new AndFilter(
>                 new TokenTypeFilter(XmlTokenType.XML_DATA_CHARACTERS),
>                 new TextStartFilter("${" + prefix + ":")
>             )
>         ),
>         XmlToken.class,
>         new MyReferenceProvider(prefix, functionClassName));
> ]]>


Thanks,
Yann



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Thanks, now it's clear to me why it doesn't work as expected.

0

Please sign in to leave a comment.