Skip to content

Commit

Permalink
Merge pull request #28 from sharwell/fix-13
Browse files Browse the repository at this point in the history
Fix navigation to members located in a different project
  • Loading branch information
sharwell authored Sep 7, 2016
2 parents 128f56d + 84e6dd8 commit cce92aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ protected override void ReParseImpl()
members.AddRange(implementingMethods);
members.AddRange(overridingMethods);

var targets = members.Select(i => new MemberTarget(textContainer, i, project, solution));
var targets = members.Select(i => new MemberTarget(textContainer, i, solution));
tags.Add(new TagSpan<IInheritanceTag>(span, _tagFactory.CreateTag(tag, builder.ToString().TrimEnd(), targets)));
}
}
Expand Down
6 changes: 2 additions & 4 deletions Tvl.VisualStudio.InheritanceMargin.CSharp/MemberTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ internal sealed class MemberTarget : IInheritanceTarget
{
private readonly SourceTextContainer _textContainer;
private readonly ISymbol _memberIdentifier;
private readonly Project _project;
private readonly Solution _solution;

public MemberTarget(SourceTextContainer textContainer, ISymbol memberIdentifier, Project project, Solution solution)
public MemberTarget(SourceTextContainer textContainer, ISymbol memberIdentifier, Solution solution)
{
_textContainer = textContainer;
_memberIdentifier = memberIdentifier;
_project = project;
_solution = solution;
}

Expand All @@ -33,7 +31,7 @@ public string DisplayName
/// <inheritdoc/>
public void NavigateTo()
{
CSharpInheritanceAnalyzer.NavigateToSymbol(_textContainer, _memberIdentifier, _project);
CSharpInheritanceAnalyzer.NavigateToSymbol(_textContainer, _memberIdentifier, _solution.GetProject(_memberIdentifier.ContainingAssembly));
}
}
}

0 comments on commit cce92aa

Please sign in to comment.