Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Formatter on files with different line-endings
Formatter on files with different line-endings [message #1218468] Fri, 29 November 2013 09:32
Siber Just Siber is currently offline Siber Just SiberFriend
Messages: 6
Registered: October 2013
Junior Member
Hi everyone,

I have implemented some custom formatting rules for my DSL, so that I overrode one-space formatter with my custom one.

I faced a problem that when I give my formatter a file with just '\n' at the end of every line, then after the very first execution (when the file is just added to a project) formatter adds some white-spaces and new lines which are not supposed to appear. After the second execution everything is fine, those new-lines disappear and the result looks as it should.

When I give it a file with the same content but only with different line endings (not with '\n', but with '\r\n') everything works fine right from the very first try.

Can somebody explain the nature of the phenomenon and maybe propose a solution to avoid invocation of the formatter two times for '\n' line-ended files?
Previous Topic:Infinite loop in UI internal ANTLR parser
Next Topic:While Parsing the xtext models,Getting Resource factory needed
Goto Forum:
  


Current Time: Thu Nov 27 01:55:29 GMT 2014

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

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