I'm creating a custom language plugin, following the Properties tutorial. Everything is working fine so far, but now I want to extend the inline renaming so that the definition and the usage of the symbols to edit are represented by different PsiElements.
So, for example, I have a single FooDecl, representing the declaration of a symbol, and many FooUsage's, representing the usage of a symbol. Navigation like Go To Declaration is working fine.
The Refactor > Rename looks fine, but when I hit Return to make the changes permanent the following exception is thrown:
ERROR - .intellij.psi.PsiReferenceBase - Cannot find manipulator for FooUsageImpl(USAGE) in foo.FooReference@5d4776b6 class class foo.FooReference
It seems that function
public static PsiElement setName(FooUsage element, String newName)
in class FooPsiImplUtil is never called, even though setName is generated into FooUsageImpl.
My Foo.xbnf look like
decl ::= DECLTOKEN
methods=[getFooDecl getName setName getNameIdentifier getPresentation]}
usage ::= USAGETOKEN
methods=[getFooUsage getName setName getNameIdentifier getReference]}
Am I missing a crucial step here?