GoogleCodeArchives / editra

Automatically exported from code.google.com/p/editra
Other
0 stars 0 forks source link

[patch] Java syntax highlighting is too plain #474

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The java syntax highlighting is minimal and doesn't really help me visually.

This patch changes the keywords distribution to allows for a richer, more
useful color scheme. 

Please note that some of the "TYPE" keywords are not all types stricto
sensus, and include common classes (String, etc) and keywords used as
values (true, false, null). Some of those keywords could be grouped
differently, but I couldn't find how to use keyword3_style and keyword4_style.

This may be a matter of taste, but I think this is an improvement over the
current implementation.

Original issue reported on code.google.com by gaudet.e...@gmail.com on 2 Feb 2010 at 8:22

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

The java mode uses the builtin Scintilla lexer for CPP it offers the following
possible keyword sets.

{{{
static const char * const cppWordLists[] = {
            "Primary keywords and identifiers",
            "Secondary keywords and identifiers",
            "Documentation comment keywords",
            "Unused",
            "Global classes and typedefs",
            0,
        };
}}}

This is the description the returned tuple in editra should be the (index, 
string of
words). The sytax spec should have a value slot for each of these keywords.

i.e)

STC_C_WORD is associated with keyword set 0
STC_C_WORD2 is associated with keyword set 1
STC_C_COMMENTDOC is associated with keyword set 2
STC_C_GLOBALCLASS is probably associated with keyword set 4

So the keywords that GetKeywords returns should be styled accordingly to the 
above
mapping by the scintilla lexer.

Will review the patch later this evening

Thanks,

Cody

Original comment by CodyPrec...@gmail.com on 2 Feb 2010 at 9:44

GoogleCodeExporter commented 9 years ago
Applied thank you

Original comment by CodyPrec...@gmail.com on 3 Feb 2010 at 3:12