Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible in Eclipse to define syntax highlighting for a language without resorting to Java programming?

I am looking for a way to define some syntax coloring for a language in Eclipse. I only need to highlight certain sets of keywords, so the logic is trivial. So I would like to be able to define these in a plain definition file. Is there perhaps some Eclipse plugin which allows this, or is it possible out of the box?

like image 649
Ola Eldøy Avatar asked Mar 10 '10 10:03

Ola Eldøy


3 Answers

XText is a more generic and complex solution, which will generate for you the code for a custom Editor able to offer the usual IDE features, that are derived from a grammar (your "plain definition file"), including.

  • syntax coloring, but also
  • model navigation (F3, etc.),
  • code completion,
  • outline view, and
  • code templates.
like image 160
VonC Avatar answered Nov 12 '22 01:11

VonC


The EclipseColorer plugin may fit the bill!

like image 34
Ola Eldøy Avatar answered Nov 12 '22 01:11

Ola Eldøy


It's a bit fiddly, but try http://gstaff.org/colorEditor/.

It uses the jEdit syntax highlighting files. So you need to create your highlighting file and add it to the jar in the plugin, as well as editing the catalog file in there to include it.

I used jEdit itself to test and debug my custom highlighting, rather than having to exit Eclipse, make the change and reload it each time.

like image 45
tvStatic Avatar answered Nov 12 '22 01:11

tvStatic