I'm trying to create a custom navigate to plugin with the Resharper SDK plugin. I have managed to get the IDeclaredElement or ITypeElement when I stand on my type doing
var referenceName = dataContext.GetSelectedTreeNode<IReferenceName>();
var declaration = referenceName?.Reference.Resolve()?.DeclaredElement as ITypeElement;
if (declaration != null)
{
//TODO: Find all usages here and check if my type is used as single argument to a method (Visitor pattern)
}
The SDK docs are really sparse and I dont find anything on the subject. Thanks
After some trial and error i Found a working solution.
IFinder.FindAllReferences
Full code here