Override LookupWindowManagerImpl

Hi.

I'm trying to override the functionality of LookupWindowManagerImpl by writing my own plugin.

I inherit LookupWindowManagerImpl override the CreateLookup method with my own implimentation but I'm having a hard time trying to make the Shell/CompositeContainer use my implementation when I set the ShellComponentImplementation attribute on my class. The CompositeContainer's ComponentDeclarationsCache throws some kind of exception saying:

The group of assemblies has no component interface for the component implementation MyLookupWindowImpl. Probably, it's in another group of assemblies, and the implementation could not be applied to it.


     (from what I gather from this, since my Plugin is loaded in a different group than the group at Shell startup, I'm not allowed to override?)

... So, how do force my component into the container to override the default implementation of the LookupWindowManager? I'm very picky about my Intellisense and I'd like to customize the default implementation even further than the UI options allow.

Much thanks,
-cowboy

2 comments
Comment actions Permalink

Also, there seems to be a problem with ActionHandlers in custom Plugins with (Keyboard Shotcuts: None).

When you create an ActionHandler in a custom in a Plugin, Resharper will register the ActionHandler with Visual Studio.

The ActionHandler's VS ID will show up in VS | Tools | Options... | Keyboard with the ability to set the Shortcut key manually. This is nice, but only works within the current VS session; the shortcut does not persist across Visual Studio restarts.

IE: If you exit Visual Studio, then enter Visual Studio again, the shortcut you set in the Visual Studio keyboard dialog is gone.

Rather annoying, but here is a work around:

    [ActionHandler]     [SolutionComponentImplementation]     public class My_ReplaceSpacesAction : IActionHandler, ISolutionComponent     {         private SingleShortcut shortcut;         public bool Update( IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate )         {             ITextControl textControl = context.GetData( JetBrains.IDE.DataConstants.TEXT_CONTROL );             // enable this action if we are in text editor, disable otherwise             return textControl != null && !textControl.Selection.GetSelectionText().IsEmpty();         }         public void Execute( IDataContext context, DelegateExecute nextExecute )         {             // Get solution from context in which action is executed             ITextControl textControl = context.GetData( JetBrains.IDE.DataConstants.TEXT_CONTROL );             if( textControl == null )                 return;             textControl.Document.ReplaceText( textControl.Selection.Range.Value.ToDocRangeNormalized(), textControl.Selection.GetSelectionText().Replace( ' ', '_' ) );         }         public void AfterSolutionOpened()         {                      }         public void BeforeSolutionClosed()         {                      }         public void Dispose()         {                      }         //bug workaround: forcibly set the shorcut ctrl+0, since shorcuts do not persist acorss VS restarts.         public void Init()         {             if( shortcut == null )             {                 var exeAction = ActionManager.Instance.GetExecutableAction( "My.ReplaceSpaces" );                 var keyboardShortcut = new KeyboardShortcut( Keys.D0, KeyboardModifiers.Control );                 shortcut = new SingleShortcut( keyboardShortcut );                 ActionManager.Instance.AddShortcut( shortcut, exeAction );             }         }     }


I even tried downloading AgentSmith plugin. AgentSmith includes an ActionHandler that gets loaded into the Keyboard dialog, and setting the shortcut only works for the current VS session, and is not persisted across VS restarts.

0
Comment actions Permalink

Also, when Resharper's Intellisense is enabled, Intellisense in the "Immediate Window" doesn't work anymore.

At the very least, I think Visual Studio's default Intellisense should be enabled in the "Immediate Window".

I'm currently looking for a workaround for this too... if anyone has ideas on how to hook/unhook Resharper from the immediate window would be appreciated.

0

Please sign in to leave a comment.