Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Hide technical UID in XText editor
Hide technical UID in XText editor [message #1747021] Tue, 08 November 2016 15:27 Go to next message
Steffen Grieser is currently offline Steffen GrieserFriend
Messages: 2
Registered: November 2016
Junior Member
Hi,

I have created a textual DSL using the Xtext framework. The target language of the DSL requires a technical UID for almost every grammar element. Once assigned to an element, the UID must not be modified in subsequent code generations. Therefore, the ID has to be part of the DSL grammar e.g.:

Element:
	uid=UID
	'element' name=ID '{'
	    children+=Element*
        '}'
;

UID: '@ID' '(' value=ID ')' ;


The problem is: this ID spoils the content in the XText editor. Therefore I am looking for a way to hide it in the XText editor. Important: this has nothing to do with 'hidden tokens' as I need the UID value in the AST during code generation but want to not show it in the XText editor.

My first idea was to remove the UID from the node nodel after parsing. Is this a sensible solution? Does anyone know a better solution?

Looking forward for any response!
Re: Hide technical UID in XText editor [message #1747233 is a reply to message #1747021] Fri, 11 November 2016 05:26 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 10333
Registered: July 2009
Senior Member
i dont know a nice way to do this. maybe you can use the folding feature to hide the IDs, but i am not sure if this will work in all cases
Re: Hide technical UID in XText editor [message #1747518 is a reply to message #1747233] Tue, 15 November 2016 15:36 Go to previous messageGo to next message
Steffen Grieser is currently offline Steffen GrieserFriend
Messages: 2
Registered: November 2016
Junior Member
Folding was my first approach. I successfully hided the uids by building a region of the uid and the name of an Element. When the region is (by default) folded, only the name feature is visible. Basically, this is exactly what I was looking for. A problem arises when the name of the Element is edited. Then, the region is unfolded automatically and the uid is visible again. Moreover, when an element is moved (cut/paste actions), it is not assured that the uid is copied with the name.

I keep the folding in mind as a fallback solution. But I am still searching for a way to solve the problem programmatically.

Anyway, thank you very much for the reply!
Re: Hide technical UID in XText editor [message #1750096 is a reply to message #1747518] Fri, 16 December 2016 06:11 Go to previous message
Puneet Patwari is currently offline Puneet PatwariFriend
Messages: 58
Registered: November 2014
Member
Hi Steffan

Did you find any solution? I am also looking for the same thing. any help will be appreciated.

Puneet
Previous Topic:Embedded Editor wont list references to an external Ecore model
Next Topic:Localization of Double values (2,4 vs. 2.4)
Goto Forum:
  


Current Time: Thu Mar 30 07:03:37 GMT 2017

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

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