I would like to manually extend the IntelliSense list by various items. I want to be responsible for the action triggered by the item (i.e. code completion and tooltip info). It doesn't matter what items.
Is this possible with an VisualStudio add-in, ReSharper / DXCore or any otherg plugin?
Background:
Some of you may know FOP (feature-oriented programming). FOP would require various changes to intellisense and editor behavior.
Edit:
Another interesting post.
This is definitely doable very easily by writing a ReSharper plugin.
Start by implementing ICodeCompletionItemsProvider
which will provide additional IntelliSense items. The easiest way is to inherit from ItemsProviderOfSpecificContext<TContext>
(with TContext
being CSharpCodeCompletionContext
if you're interested in C# code completion).
Your provider will add the additional items in the implementation of AddLookupItems()
. You have the chance to provide a custom implementation of ILookupItem
here: the Accept()
method of this interface will be called when the user chooses the item in the completion popup. Here is your chance to execute the code you need.
Note that this information is for R# 6.1/7.0. I don't think it is much different in previous versions though. Obviously, you have to enable ReSharper IntelliSense instead of Visual Studio IntelliSense for this to work.