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

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".


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
Previous Topic:Formatter2 Line Numbers
Next Topic:Xtend replacement for DSL creation?
Goto Forum:

Current Time: Thu May 13 10:36:51 GMT 2021

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

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

Back to the top