I don't want to say I'm at the last of my headaches with Formatter2, but I'm getting close.
I've put off getting proper formatting of my QualifiedNames for a while now, but now I can't put it off any longer.
In my formatter code, I have retrieved the region for my feature. "region" here being an NodeSemanticRegion
If I examine the region.text, I see in the debugger, my qualified name written like this:
So there are single white spaces between each QualifiedName delimiter.
I've spent at least 2 hours trying to eliminate those spaces and I can't figure it out. Hardly any of the API for region have any comment or text whatsoever.
Something like region.createWhiteSpaceReplacer seems like it would be a fit, but no docs.
This also seems like it's trivially basic to anyone who knows what they are doing - clearly not myself.
I've tried:
val keywords = regionFor.keywords(".")
for (keyword : keywords) {
keyword.surround[highPriority; noSpace]
}
But on this region, there are no '.' keywords returned.
I can't seem to replace region.text .replace(" ", "") either. Doesn't seem theres a setText api to region.
Lost. Totally lost. Over white space surround a period.
[Updated on: Thu, 07 November 2019 16:17] by Moderator