From 658c1d2c53911cd63257b2179476f4c1dcd953e4 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 22 Feb 2013 17:19:47 +0100 Subject: [PATCH] C# syntax highlighting: Move contextual keywords into other keyword categories Semantic highlighting will undo the keyword highlighting when the keyword is used as an identifier. --- .../Project/Resources/CSharp-Semantic.xshd | 20 +++++++++---------- .../FindReferenceService.cs | 6 ++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd b/src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd index facdaaec06..c03540303c 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd @@ -17,7 +17,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -151,6 +151,11 @@ in while lock + global + var + dynamic + await + where @@ -158,13 +163,10 @@ continue goto return + yield - - yield - partial - global - where + select group by @@ -177,9 +179,6 @@ join on equals - var - dynamic - await @@ -250,6 +249,7 @@ virtual volatile async + partial diff --git a/src/Main/Base/Project/Src/Services/RefactoringService/FindReferenceService.cs b/src/Main/Base/Project/Src/Services/RefactoringService/FindReferenceService.cs index 73896526f4..d838ada432 100644 --- a/src/Main/Base/Project/Src/Services/RefactoringService/FindReferenceService.cs +++ b/src/Main/Base/Project/Src/Services/RefactoringService/FindReferenceService.cs @@ -108,7 +108,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring var fileName = FileName.Create(variable.Region.FileName); List references = new List(); await SD.ParserService.FindLocalReferencesAsync( - fileName, variable, + fileName, variable, r => { lock (references) references.Add(r); }, cancellationToken: progressMonitor.CancellationToken); return new SearchedFile(fileName, references); @@ -173,7 +173,9 @@ namespace ICSharpCode.SharpDevelop.Refactoring var graph = BuildTypeInheritanceGraph(compilations); TypeGraphNode node; if (graph.TryGetValue(new AssemblyQualifiedTypeName(baseType), out node)) { - node.BaseTypes.Clear(); // only derived types were requested, so don't return the base types + // only derived types were requested, so don't return the base types + // (this helps the GC to collect the unused parts of the graph more quickly) + node.BaseTypes.Clear(); return node; } else { return new TypeGraphNode(baseType);