Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to update text in comments?
How to update text in comments? [message #720073] Mon, 29 August 2011 20:08 Go to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Greetings,

I have a grammar that "extends" (is that the correct word?) org.eclipse.xtext.common.Terminals ( http://code.google.com/p/protobuf-dt/source/browse/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext .)

My question is, how can I update the text of comments (single-line or multi-line)?

For example, the proto editor has a feature to generate the next id of a message field. If the message has a comment like:

// Next Id: 2

I'd like to update such comment to:

// Next Id: 3

After generating the id of a new message field.

Many thanks in advance,
-Alex
(no subject) [message #720199 is a reply to message #720073] Tue, 30 August 2011 05:53 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Alex,

you have to do that by manipulating the document or the input file
directly. Another option is to override some components of the
serializer to 'inject' other comments for your objects but I think this
would be more effort.

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

On 29.08.11 22:08, Alex Ruiz wrote:
> Greetings,
>
> I have a grammar that "extends" (is that the correct word?)
> org.eclipse.xtext.common.Terminals (
> http://code.google.com/p/protobuf-dt/source/browse/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
> .)
>
> My question is, how can I update the text of comments (single-line or
> multi-line)?
>
> For example, the proto editor has a feature to generate the next id of a
> message field. If the message has a comment like:
>
> // Next Id: 2
>
> I'd like to update such comment to:
>
> // Next Id: 3
>
> After generating the id of a new message field.
>
> Many thanks in advance,
> -Alex
Re: (no subject) [message #720560 is a reply to message #720199] Tue, 30 August 2011 20:00 Go to previous message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Thanks Sebastian for the suggestion. I'll give it a try Smile

Cheers,
-Alex
Previous Topic:How to change the text "Xtext Check" from markers?
Next Topic:How to react to change in AutoEditStrategyProvider
Goto Forum:
  


Current Time: Wed Apr 24 18:20:49 GMT 2024

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

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

Back to the top