Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Highlight certain parts in comments
Highlight certain parts in comments [message #1040317] Sat, 13 April 2013 11:01 Go to next message
Maximilian Girlich is currently offline Maximilian GirlichFriend
Messages: 17
Registered: March 2013
Junior Member
Hey,

I was wondering whether it is possible to highlight certain parts e.g. links starting with @file in a comment. For example:

//this is a comment and then I have a link @file://a/link/to.somewhere and now the comment continues

I tried something like

terminal LINK:
	'@file://' -> ' '
;

terminal SL_COMMENT:
	';' (LINK | !( '@' | '\n' | '\r' ) )* ('\r'? '\n')?
;


but there is no node created for the LINK in SL_COMMENT. Is this possible at all?

Thanks in advance,
Maximilian
Re: Highlight certain parts in comments [message #1040348 is a reply to message #1040317] Sat, 13 April 2013 12:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
What about using a datatype rule?
or reparse the comment yourself


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Highlight certain parts in comments [message #1040417 is a reply to message #1040348] Sat, 13 April 2013 14:53 Go to previous messageGo to next message
Maximilian Girlich is currently offline Maximilian GirlichFriend
Messages: 17
Registered: March 2013
Junior Member
At the moment I do parse the comments myself. I was just wondering whether there was a nice 'built-in' solution for that. As the text to be highlighted is in comments (--> they have to be hidden) I need a terminal rule.
Re: Highlight certain parts in comments [message #1040449 is a reply to message #1040417] Sat, 13 April 2013 15:58 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2013-13-04 16:53, Maximilian Girlich wrote:
> At the moment I do parse the comments myself. I was just wondering
> whether there was a nice 'built-in' solution for that. As the text to be
> highlighted is in comments (--> they have to be hidden) I need a
> terminal rule.

I do extensive comment formatting and coloring of comment text in
cloudsmith / geppetto @ github if you are interested in looking at code.

Geppetto has a markdown/rdoc type comment processor (handles
bold, italic, headers, bulleted lists, preformatted etc. etc.)
There is also configurable styling for the comment formatting.

Regards
- henrik
Re: Highlight certain parts in comments [message #1040460 is a reply to message #1040449] Sat, 13 April 2013 16:25 Go to previous message
Maximilian Girlich is currently offline Maximilian GirlichFriend
Messages: 17
Registered: March 2013
Junior Member
Okay, thanks! I gonna have a look at it and hope it won't be too complicated Wink
Previous Topic:Is it possible to define and use "enum" in the ".dmodel" file?
Next Topic:Automatic handling of errors/warnings
Goto Forum:
  


Current Time: Fri Apr 19 15:38:57 GMT 2024

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

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

Back to the top