Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit c621797

Browse files
fix #541: Allow configuring color for interfaces (etc.) in C# semantic highlighting
1 parent 8ace234 commit c621797

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232

3333
<!-- Colors used for semantic highlighting -->
3434
<Color name="ReferenceTypes" foreground="#004085" exampleText="System.#{#Uri#}# uri;"/>
35+
<Color name="InterfaceTypes" foreground="#004085" exampleText="System.#{#IDisposable#}# obj;"/>
36+
<Color name="TypeParameters" foreground="#004085" exampleText="class MyList&lt;#{#T#}#&gt; { }"/>
37+
<Color name="DelegateTypes" foreground="#004085" exampleText="System.#{#Action#}#; action;"/>
3538
<Color name="ValueTypes" fontWeight="bold" foreground="#004085" exampleText="System.#{#DateTime#}# date;"/>
39+
<Color name="EnumTypes" fontWeight="bold" foreground="#004085" exampleText="System.#{#ConsoleKey#}# key;"/>
3640
<Color name="MethodCall" foreground="MidnightBlue" fontWeight="bold" exampleText="o.#{#ToString#}#();"/>
3741
<Color name="FieldAccess" fontStyle="italic" exampleText="return this.#{#name#}#;"/>
3842
<Color name="InactiveCode" foreground="Gray" exampleText="#{#Deactivated by #if#}#"/>

src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighterVisitor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public CSharpSemanticHighlighterVisitor(CSharpSemanticHighlighter highlighter, I
5858
//this.defaultTextColor = ???;
5959
this.referenceTypeColor = highlighting.GetNamedColor("ReferenceTypes");
6060
this.valueTypeColor = highlighting.GetNamedColor("ValueTypes");
61-
this.interfaceTypeColor = this.referenceTypeColor;
62-
this.enumerationTypeColor = this.valueKeywordColor;
63-
this.typeParameterTypeColor = this.referenceTypeColor;
64-
this.delegateTypeColor = this.referenceTypeColor;
61+
this.interfaceTypeColor = highlighting.GetNamedColor("InterfaceTypes");
62+
this.enumerationTypeColor = highlighting.GetNamedColor("EnumTypes");
63+
this.typeParameterTypeColor = highlighting.GetNamedColor("TypeParameters");
64+
this.delegateTypeColor = highlighting.GetNamedColor("DelegateType");
6565
this.methodDeclarationColor = this.methodCallColor = highlighting.GetNamedColor("MethodCall");
6666
//this.eventDeclarationColor = this.eventAccessColor = defaultTextColor;
6767
//this.propertyDeclarationColor = this.propertyAccessColor = defaultTextColor;

0 commit comments

Comments
 (0)