我正在尝试使用 Resharper SDK 插件创建自定义导航插件。当我站在我的类型上时,我设法获得了 IDeclaredElement 或 ITypeElement
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)
}
SDK 文档非常稀少,我没有找到任何关于该主题的内容。谢谢