Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Autoindent code
Autoindent code [message #953495] Mon, 22 October 2012 09:44 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi,

I only found a very old thread about this issue: if I want to automatically get the right indentation while writing code, for example after a "{ CR", is there any support in Xtext? I mean, do I have to reformat the whole file?

The problem is that the code after the one I'm writing is probably not syntactically correct (in the example a "}" is missing), so it's not certain that the formatter will be able to do a good job. BTW, can just a chunk of code be reformatted?

best regards,
Vlad
Re: Autoindent code [message #953614 is a reply to message #953495] Mon, 22 October 2012 11:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

did you have a look at auto edit (org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategyProvider)
?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Autoindent code [message #953635 is a reply to message #953614] Mon, 22 October 2012 12:06 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Doh! Thanks Christian,

I was so in to my other problem with the formatter that I only searched the 'net, not the code...

regards,
Vlad
Previous Topic:re-generate captured text
Next Topic:Xtext for textual editing of CDO objects
Goto Forum:
  


Current Time: Wed Sep 25 14:37:49 GMT 2024

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

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

Back to the top