Extending java syntax coloring [message #518333] |
Wed, 03 March 2010 15:10  |
Eclipse User |
|
|
|
Hi all,
I work a lot with java code, that uses some DSL inside strings, like
myJavaMethod("from x : V with x.count < 17 reportSet x end");
Is there a way to extend the usual syntax coloring for java with some
basic highlighting inside java string literals?
For now, I would be fully satisfied with making a fixed set of DSL
keywords bold inside strings. In the example above, those are "from",
"with", "reportSet" and "end".
I had a brief look at the JDT docs, and if I understand correctly, the
coloring is done by some lexer (aka RuleBasedScanner) returning a token
list, and the color for each token is determined by some IColorManager.
And of course, for a java lexer a string literal is one single token, so
any highlighting inside string literals is impossible.
Please tell me that I am either totally wrong, or that I'm right but the
thing I want to do is still easily possible. ;-)
I appreciate any pointers!
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
|
Re: Extending java syntax coloring [message #523419 is a reply to message #518333] |
Fri, 26 March 2010 07:46  |
Eclipse User |
|
|
|
Tassilo Horn wrote:
> Hi all,
>
> I work a lot with java code, that uses some DSL inside strings, like
>
> myJavaMethod("from x : V with x.count < 17 reportSet x end");
>
> Is there a way to extend the usual syntax coloring for java with some
> basic highlighting inside java string literals?
>
No.
Dani
> For now, I would be fully satisfied with making a fixed set of DSL
> keywords bold inside strings. In the example above, those are "from",
> "with", "reportSet" and "end".
>
> I had a brief look at the JDT docs, and if I understand correctly, the
> coloring is done by some lexer (aka RuleBasedScanner) returning a token
> list, and the color for each token is determined by some IColorManager.
> And of course, for a java lexer a string literal is one single token, so
> any highlighting inside string literals is impossible.
>
> Please tell me that I am either totally wrong, or that I'm right but the
> thing I want to do is still easily possible. ;-)
>
> I appreciate any pointers!
>
> Tassilo
>
|
|
|
Powered by
FUDForum. Page generated in 0.02963 seconds