Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » New Formatting API 2: Indentation of EObject
New Formatting API 2: Indentation of EObject [message #1699274] Tue, 23 June 2015 08:11
Aleksandar Toshovski is currently offline Aleksandar ToshovskiFriend
Messages: 78
Registered: December 2011
Member
I have the following problem: The identation in my project doesn't work. I have the following structure:

model --> n Procedure -->1 Body -->n Lines

Example:
def test() { 
.test 
.test 
.tralala 
	.test
}

I try to indent the lines inside the procedure by using the following code:

def dispatch void format(ProcedureStructure entity, extension IFormattableDocument document) {
		entity.regionFor.keyword(")").prepend[noSpace]
		entity.regionFor.keyword("(").prepend[noSpace]
		val open = entity.regionFor.keyword("{")
		val close = entity.regionFor.keyword("}")
		interior(open, close)[indent]
		format(entity.getBody(), document);
	}


The first two lines work like expected, but identation doesn't work at all. Can you give me some hints how to solve that problem?

is it possible to indent the Line object ? I have tried also to use a keyword in order to format the lines, but indent still doesn't work:

line.regionFor.keyword(".").prepend[indent]


The methods are called, but I don't see any changein the editor. I'm using Xtext 2.9 from 22.05

Previous Topic:Xtext Builder runs into a compile error
Next Topic:problems with global scoping
Goto Forum:
  


Current Time: Tue Mar 19 10:27:49 GMT 2024

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

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

Back to the top