Browse Source

Initialize all the colors for semantic highlighting.

pull/32/merge
Daniel Grunwald 13 years ago
parent
commit
2eeb58101d
  1. 1
      src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd
  2. 16
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighter.cs
  3. 1
      src/Main/Base/Project/Src/Project/AbstractProject.cs

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

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
<Color name="MethodCall" foreground="MidnightBlue" fontWeight="bold" exampleText="o.#{#ToString#}#();"/>
<Color name="FieldAccess" fontStyle="italic" exampleText="return this.#{#name#}#;"/>
<Color name="InactiveCode" foreground="Gray" exampleText="#{#Deactivated by #if#}#"/>
<Color name="SemanticError" foreground="DarkRed" exampleText="o.#{#MissingMethod#}#()"/>
<RuleSet name="CommentMarkerSet">
<Keywords fontWeight="bold" foreground="Red">

16
src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighter.cs

@ -47,11 +47,23 @@ namespace CSharpBinding @@ -47,11 +47,23 @@ namespace CSharpBinding
//this.defaultTextColor = ???;
this.referenceTypeColor = highlighting.GetNamedColor("ReferenceTypes");
this.valueTypeColor = highlighting.GetNamedColor("ValueTypes");
this.methodCallColor = highlighting.GetNamedColor("MethodCall");
this.fieldAccessColor = highlighting.GetNamedColor("FieldAccess");
this.interfaceTypeColor = this.referenceTypeColor;
this.enumerationTypeColor = this.valueKeywordColor;
this.typeParameterTypeColor = this.referenceTypeColor;
this.delegateTypeColor = this.referenceTypeColor;
this.methodDeclarationColor = this.methodCallColor = highlighting.GetNamedColor("MethodCall");
//this.eventDeclarationColor = this.eventAccessColor = defaultTextColor;
//this.propertyDeclarationColor = this.propertyAccessColor = defaultTextColor;
this.fieldDeclarationColor = this.fieldAccessColor = highlighting.GetNamedColor("FieldAccess");
//this.variableDeclarationColor = this.variableAccessColor = defaultTextColor;
//this.parameterDeclarationColor = this.parameterAccessColor = defaultTextColor;
this.valueKeywordColor = highlighting.GetNamedColor("NullOrValueKeywords");
//this.externAliasKeywordColor = ...;
this.parameterModifierColor = highlighting.GetNamedColor("ParameterModifiers");
this.inactiveCodeColor = highlighting.GetNamedColor("InactiveCode");
this.syntaxErrorColor = highlighting.GetNamedColor("SemanticError");
if (document is TextDocument && SD.MainThread.CheckAccess()) {
// Use the cache only for the live AvalonEdit document

1
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -46,7 +46,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -46,7 +46,6 @@ namespace ICSharpCode.SharpDevelop.Project
this.Name = information.ProjectName;
this.FileName = information.FileName;
this.idGuid = (information.IdGuid != Guid.Empty ? information.IdGuid : Guid.NewGuid());
Debug.Assert(information.TypeGuid != Guid.Empty);
this.TypeGuid = information.TypeGuid;
if (information.ProjectSections != null)
this.projectSections.AddRange(information.ProjectSections);

Loading…
Cancel
Save