Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Removing hidden nodes via API
Removing hidden nodes via API [message #1005633] Sun, 27 January 2013 20:38 Go to next message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
I need to implement an action that strips all the comments in the open editor. Comments are marked as hidden in the grammar. Any clue on how to do this?

Thanks,
Pawel
Re: Removing hidden nodes via API [message #1005675 is a reply to message #1005633] Mon, 28 January 2013 08:58 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Here is roughly what you have to do inside such an action
-Iterate the node model (XtextResource.getParseResult().getRootNode())
-Find those nodes belonging to the comment rule (node.getGrammarElement())
-Compose a MultiTextEdit with ReplaceEdits for the code segments of the
comments
-apply the MultiTextEdit to the document

Am 27.01.13 21:38, schrieb Pawel Pogorzelski:
> I need to implement an action that strips all the comments in the open
> editor. Comments are marked as hidden in the grammar. Any clue on how to
> do this?
>
> Thanks,
> Pawel


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: Removing hidden nodes via API [message #1005704 is a reply to message #1005675] Mon, 28 January 2013 10:58 Go to previous message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
Thanks Jan.

Pawel
Previous Topic:Noobie Q: Problem to run the Generated IDE Plug-in of my DSL (Xtext) with Eclipse Juno.
Next Topic:ParserBasedContentAssistContextFactory.StatefulFactory mixing instances of the same grammar
Goto Forum:
  


Current Time: Tue Mar 19 02:48:58 GMT 2024

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

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

Back to the top