Browse Source

Add highlighting for var and dynamic

pull/1198/head
Siegfried Pammer 7 years ago
parent
commit
cb45db6b86
  1. 3
      ILSpy/Languages/CSharpHighlightingTokenWriter.cs

3
ILSpy/Languages/CSharpHighlightingTokenWriter.cs

@ -125,7 +125,6 @@ namespace ICSharpCode.ILSpy
case "foreach": case "foreach":
case "lock": case "lock":
case "global": case "global":
case "dynamic":
case "await": case "await":
color = structureKeywordsColor; color = structureKeywordsColor;
break; break;
@ -291,6 +290,8 @@ namespace ICSharpCode.ILSpy
HighlightingColor color = null; HighlightingColor color = null;
if (identifier.Name == "value" && identifier.Ancestors.OfType<Accessor>().FirstOrDefault() is Accessor accessor && accessor.Role != PropertyDeclaration.GetterRole) if (identifier.Name == "value" && identifier.Ancestors.OfType<Accessor>().FirstOrDefault() is Accessor accessor && accessor.Role != PropertyDeclaration.GetterRole)
color = valueKeywordColor; color = valueKeywordColor;
if ((identifier.Name == "dynamic" || identifier.Name == "var") && identifier.Parent is AstType)
color = queryKeywordsColor;
switch (GetCurrentDefinition()) { switch (GetCurrentDefinition()) {
case ITypeDefinition t: case ITypeDefinition t:
switch (t.Kind) { switch (t.Kind) {

Loading…
Cancel
Save