I was able to get code completion to work for a text field in my plugin based on the answer here: Text Field with Standard PsiElement Auto Completion in IntelliJ Plugin
But that's only a part of the problem. In my field I need to express plain text plus Java expressions e.g.:
This is plain text and here's a Java expression {myJavaObject.myMethod()} here's more text and a variable {var}
This is a pretty standard concept in Java. I'd like completion and syntax highlighting to only apply within the curly braces. Is this possible? If so how would one go about implementing this?