Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Double comment bug when using autoformat
Double comment bug when using autoformat [message #1031957] Tue, 02 April 2013 12:06 Go to next message
Maximilian Girlich is currently offline Maximilian Girlich
Messages: 17
Registered: March 2013
Junior Member
Hi,

when using autoformat via Strg + Shift + F in my ini-Editor some of my comments are doubled. A (minimal) working example seems to be

[ d ]
; 
m 


Using the autoformat command twice will produce

[ d ] ; 
; 
; 
; 
m


Without the last line (the 'm') this doesn't happen.

My grammar is

grammar iniEditor.INIEditor with org.eclipse.xtext.common.Terminals hidden (INI_COMMENT, WS)

generate iNIEditor "INIEditor.iniEditor"

Domainmodel :
	execalls+=ExeCall*
;
	
ExeCall :
	Exe
	arguments += Argument*
;

Exe:
	'[' name = ID ']'
;

Argument:
	(Arg | Def) AGN Argumentstring ('\r'? '\n')?
;

Arg :
	name = Name
;

Def :
	name = Defname
;

Defname :
	'#' Name
;

Name:
	ID ('_' INT | '<' INT '>')?
;

Argumentstring:
	(ID | STRING | INT | '-' | '%' | '.' | '\\' | '?' | ':' | '*' | '/' | '<>' | '[]' | '{}' | '()')*
;

terminal INI_COMMENT:
	';' !('\n'|'\r')* ('\r'? '\n')?
;

terminal AGN:
	'='
;


I have no idea why this is happening. As I am new to xtext I don't know whether it is due to my grammar or due to xtext. By the way, is the grammar okay like that or do I make something which should not be done?

Thank you for your help!

Maximilian
Re: Double comment bug when using autoformat [message #1033675 is a reply to message #1031957] Thu, 04 April 2013 14:02 Go to previous messageGo to next message
Maximilian Girlich is currently offline Maximilian Girlich
Messages: 17
Registered: March 2013
Junior Member
Does no one have an idea why this might be the case? Can you try whether you get this behaviour aswell? It is really confusing me...

Thank you,
Maximilian
Re: Double comment bug when using autoformat [message #1033712 is a reply to message #1033675] Thu, 04 April 2013 14:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6301
Registered: July 2009
Senior Member
Did you customize IHiddenTokenHelper?
Re: Double comment bug when using autoformat [message #1034307 is a reply to message #1033712] Fri, 05 April 2013 09:12 Go to previous messageGo to next message
Claudio Heeg is currently offline Claudio Heeg
Messages: 75
Registered: April 2013
Member
What does your formatter look like?
Re: Double comment bug when using autoformat [message #1034692 is a reply to message #1034307] Fri, 05 April 2013 19:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6301
Registered: July 2009
Senior Member
Did not change anything. Can you share a complete project?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Double comment bug when using autoformat [message #1038943 is a reply to message #1034692] Thu, 11 April 2013 14:33 Go to previous message
Maximilian Girlich is currently offline Maximilian Girlich
Messages: 17
Registered: March 2013
Junior Member
Sorry for taking so long to answer...
I don't know what was going on but now it's working fine Smile And I couldn't reproduce the bug. Thanks for trying to help!
Previous Topic:Cross referencing from EMF to Xtext
Next Topic:Get position of a keyword/ rule, formatter
Goto Forum:
  


Current Time: Wed Sep 17 23:53:07 GMT 2014

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

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