Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Formatter2 Text Replacement(Replacing identifiers or keywords with Formatter2)
Formatter2 Text Replacement [message #1839650] Thu, 25 March 2021 08:08
Henning M is currently offline Henning MFriend
Messages: 2
Registered: March 2021
Junior Member
Hello,

I want to use the Formatter2 API to replace text in a semantic region.
A language has statements which contain the keyword "create". During auto format all occurrences of this keyword shall be replaced by "new".

hg

def dispatch void format(Statement statement, extension IFormattableDocument document) {
    val keyword = statement.regionFor.keyword("create")
    // replace "create" with "new"
}



How can this be achieved?

Thanks for your help
Henning
Previous Topic:How to I get a handle on my language's Grammar/Grammar Access?
Next Topic:Formatter2 Line Numbers
Goto Forum:
  


Current Time: Fri Apr 26 07:18:19 GMT 2024

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

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

Back to the top