Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Formatter2 - QualifiedName formatted with spaces between delimeter
Formatter2 - QualifiedName formatted with spaces between delimeter [message #1816829] Thu, 07 November 2019 21:10 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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:

com . lib . item . 1.0


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 21:17]

Report message to a moderator

Re: Formatter2 - QualifiedName formatted with spaces between delimeter [message #1816831 is a reply to message #1816829] Thu, 07 November 2019 22:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
I assume you meant to post this on the TMF forum.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Formatter2 - QualifiedName formatted with spaces between delimeter [message #1816858 is a reply to message #1816831] Fri, 08 November 2019 15:28 Go to previous message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
You're correct. Sorry about that. I'll ask the mods to delete.
Previous Topic:EMF Compare - ADD / DELETE differences list
Next Topic:Run Eclipse Epsilon code generation online
Goto Forum:
  


Current Time: Fri Mar 29 11:32:53 GMT 2024

Powered by FUDForum. Page generated in 0.02342 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top