How to get window context so I can create NavigationOptions in resharper plugin
In my context, I am not getting a call with IDataContext
I am attached ICSharpContextActionDataProvider
at build time. I can get IDeclaredElement
from this to base my navigation solution, but I'm not sure how to instantiate it NavigationOptions
. It seems to me that I should use NavigationOptions.FromWindowContext
, but it seems to me that I need it PopupWindowContextSource
, and I don't know where to get one of them.
So where can I get the appropriate one PopupWindowContextSource
to create mine NavigationOptions
from?
source to share
You might find it helpful to use NavigationOptions.FromDataContext
. This will pull the window context out of the IDataContext
one you already have. This should give you the context of the popup window corresponding to where you were called from - tied to an editor window or tree view or the like. Using MainWindowPopupContext
will give you a context based on the main Visual Studio window, which will probably work and be fine, but may not be the most relevant.
source to share