Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360967 - Add more default themes for syntax highlighting
Summary: Add more default themes for syntax highlighting
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.3 RC3   Edit
Assignee: Mark Macdonald CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 09:47 EDT by John Arthorne CLA
Modified: 2011-10-18 14:23 EDT (History)
3 users (show)

See Also:
john.arthorne: review+
simon_kaegi: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-10-14 09:47:21 EDT
0.3 RC2

I tried writing a simple syntax highlighting grammary for ruby. It worked, but because we only define a very minimal CSS theme, most of it appeared not to work. I think we should provide default theme styles for the most basic grammar structures. Otherwise anyone attempting to write a grammar is likely to be frustrated as it won't appear to work.

Note that we have bug 347493 that tracks allowing plugins to contribute CSS. I'm suggesting we add a few extra CSS classes in 0.3 so people can write minimal syntax highlighters. TextMate defines a reasonably small set of top-level groups, and I suggest we define a default style for each of these:

comment
constant
entity
invalid
keyword
markup
meta
storage
string
support
variable

I see these are already stubbed in default-theme.css but currently commented out.
Comment 1 Mark Macdonald CLA 2011-10-14 09:56:21 EDT
I agree, this should be part of the polish work for RC3.
Comment 2 Mark Macdonald CLA 2011-10-18 12:05:44 EDT
According to the TextMate docs, "support" is quite abstract, so I'm not sure a default style is appropriate there. 

Here's the change, on a topic branch:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=bug360967&id=a34fcf5a47669e793c61f6d80b105122495a67e4


In a few places I used specialized rules to avoid styling very different constructs the same way. For example "keyword" affects both keyword.control (if, while) and keyword.operator (&&, ||) which normally we don't want to look the same.
Comment 3 Mark Macdonald CLA 2011-10-18 12:16:35 EDT
x
Comment 4 Simon Kaegi CLA 2011-10-18 12:42:51 EDT
I'm fine with this, and as an aside I like this direction where there are "well-known" and documented style names and am still pretty against injecting arbitrary CSS.
Comment 5 John Arthorne CLA 2011-10-18 13:13:55 EDT
Looks good to me. Your defaults look reasonable. I tried with my toy ruby syntax highlighter and it worked well. I also checked that our HTML files still highlight nicely.