Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Double comment bug when using autoformat
Double comment bug when using autoformat [message #1031957] Tue, 02 April 2013 08:06 Go to next message
Eclipse UserFriend
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 10:02 Go to previous messageGo to next message
Eclipse UserFriend
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 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Did you customize IHiddenTokenHelper?
Re: Double comment bug when using autoformat [message #1034307 is a reply to message #1033712] Fri, 05 April 2013 05:12 Go to previous messageGo to next message
Eclipse UserFriend
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 15:32 Go to previous messageGo to next message
Eclipse UserFriend
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 10:33 Go to previous message
Eclipse UserFriend
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: Thu Jul 10 04:39:22 EDT 2025

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

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

Back to the top