We added a bug report for this as the behavior we see simply cannot be correct.
The problem is that the IntellijIdeaRulezzz string keeps getting added to my input. It seems to occur exactly during autocomplete as this comment says:
* A default string that is inserted to the file before completion to guarantee that there'll always be some non-empty element there
public static @NonNls final String DUMMY_IDENTIFIER = "IntellijIdeaRulezzz ";
Sometimes the lexer is only told to scan up until the “I”, but sometimes the end of the input to scan is at the last z. This seems like a hack, right? My experience so far is that the source code for intellij is really good (of course completely without comments where you need them but we all know that). This is the first bit of code that looks truly wrong/bad.
I see it again *as a literal* and in lowercase elsewhere:
final String fakeInitializer = "intellijidearulezzz";
in class IntroduceVariableBase.
Does anybody have any idea how we can get around this? Sam Harwell, my co-author on ANTLR, said that he added a CompletionContributor that set the dummy identifier to "", which would prevent it from adding that string. Unfortunately that seem to completely break the framework as it relies on that being a unique string in the document. [I should point out that Sam is extremely experienced at constructing plugins/IDEs.]
Context: I'm working on the ANTLR plug-in and this has cost me days of time.
thanks for any help or hints!