Browse Source

Fix bug in C# find references.

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
56d93e11d8
  1. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs

@ -108,7 +108,7 @@ namespace CSharpBinding
highlighter = SD.EditorControlService.CreateHighlighter(document); highlighter = SD.EditorControlService.CreateHighlighter(document);
} }
Identifier identifier = node.GetChildByRole(Roles.Identifier); Identifier identifier = node.GetChildByRole(Roles.Identifier);
if (identifier != null) if (!identifier.IsNull)
node = identifier; node = identifier;
var region = new DomRegion(fileName, node.StartLocation, node.EndLocation); var region = new DomRegion(fileName, node.StartLocation, node.EndLocation);
int offset = document.GetOffset(node.StartLocation); int offset = document.GetOffset(node.StartLocation);
@ -117,6 +117,7 @@ namespace CSharpBinding
var defaultTextColor = highlighter != null ? highlighter.DefaultTextColor : null; var defaultTextColor = highlighter != null ? highlighter.DefaultTextColor : null;
results.Add(new Reference(region, result, offset, length, builder, defaultTextColor)); results.Add(new Reference(region, result, offset, length, builder, defaultTextColor));
}, cancellationToken); }, cancellationToken);
if (results.Count > 0)
callback(new SearchedFile(fileName, results)); callback(new SearchedFile(fileName, results));
} }
} }

Loading…
Cancel
Save