resharper-plugins

How do I create a `ITypeElement` with represents a closed generic type in a ReSharper plugin?

随声附和 提交于 2019-12-13 02:35:15
问题 I'm using the ReSharper 8 sdk and want to find all inheritors of a particular generic interface, where the generic type is a particular type. I have asked a more general question which got most of the way there, but I am only able to find any implementation of ICommandHandler<T> and not the one implementation I want, ICommandHandler<TestCommand> this is the code I have: foreach (var psiModule in declaredElement.GetPsiServices().Modules.GetModules()) { IDeclaredType genericType = TypeFactory

Resharper API for selected text and remote code generation

ⅰ亾dé卋堺 提交于 2019-12-12 13:55:30
问题 I'd like to write a Resharper plugin that lets me generate code in another class based on highlighted text, and the API isn't the most transparent. What methods should I look at to get access to selected text, and to code generation outside of the current class? 回答1: When you are writing context action or something like this (read here http://confluence.jetbrains.net/display/ReSharper/ReSharper+7+Plugin+Development about actions and context actions), you receive an instance of IDataContext.

How do I get a window context so I can create NavigationOptions in a resharper plugin

北战南征 提交于 2019-12-08 04:21:35
问题 I have a navigation plugin which I want to extend to allow support for context navigation. I've got everything I need except for the NavigationOptions instance. In my INavigateFromHereProvider I get called with an IDataContext so can create the NavigationOptions from this using the NavigationOptions.FromDataContext method. Great. In my context action I don't get called with a IDataContext , I get given a ICSharpContextActionDataProvider during construction. I can get my IDeclaredElement from

Create a generic type to find implementations of in a Resharper plugin

怎甘沉沦 提交于 2019-12-04 04:12:38
问题 I'm writing a plugin for resharper which I want to use to navigate from a ConcreteCommand -> ConcreteCommandHandler where those types look like this public class ConcreteCommand : ICommand public class ConcreteCommandHandler : ICommandHandler<ConcreteCommand> I've got as far as adding my navigation menu option when the cursor is on a ICommand instance/definition (currently only by checking if the name contains 'Command' and not 'CommandHandler'), and I think I have the code necessary to

Create a generic type to find implementations of in a Resharper plugin

六眼飞鱼酱① 提交于 2019-12-01 20:35:12
I'm writing a plugin for resharper which I want to use to navigate from a ConcreteCommand -> ConcreteCommandHandler where those types look like this public class ConcreteCommand : ICommand public class ConcreteCommandHandler : ICommandHandler<ConcreteCommand> I've got as far as adding my navigation menu option when the cursor is on a ICommand instance/definition (currently only by checking if the name contains 'Command' and not 'CommandHandler'), and I think I have the code necessary to actually search for a type which inherits something, but my issue is that the only thing I actually have a