How to replace Navigator and WindowUtil methods in 4.5 API?

Could some kind soul please tell me how to replace the following Resharper plugin API methods which I had working fine under 4.1 so that I may hopefully get it running again under 4.5...

(1) WindowUtil.ShowInfoMessage and WindowUtil.ShowYesNoMessage

(2) Navigator.NavigateDeclaredElement
I need this because given an ITypeElement I want to jump to a method which starts with a value - this code extract works under 4.1:

                IList<IMethod> methods = typeElement.Methods;
                foreach (IMethod method in methods)
                {
                    if (method.ShortName.StartsWith(partialMethodName))
                    {
                        // Want to navigate to this method.
                        Navigator.NavigateDeclaredElement(method, true);
                        return;
                    };
                }


FYI My plug-in gives me "Goto Test" functionality via a context menu in the IDE. If you are in a class "Foo" in method "Bar" and choose my Goto Test menu option, it will look for a "FooTest" class (using some specific naming conventions I use in my projects) and if not present in the solution create a file in the appropriate project. It will then add a "Bar" test method stub. Alternatively if "FooTest" existed it would open it up and navigate to the first test method that started with "Bar".

Many thanks for your help.

2 comments

Hi,

Please take a look at migration guide: http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+PlugIn+4.0(4.1)+to+4.5+Migration+Guide
As for other symbols, you can most likely use "Go to symbol" to find what you need. Just select checkbox to search in libraries. Show message functions were moved to JetBrains.Util.MessageBox class.

0

Hmmm, ok thx, I guess "Go To Symbol" it is then (FYI - the migration guide is next to useless for it's brevity).

For anyone reading this and wondering...
- As indicated by IIya, the WindowUtil methods I was after above now exist on the MessageBox class.
- Navigator.NavigateDeclaredElement is replaced by one of the overloads of NavigationManager.Navigate(...)
- Numerous other API changes/reference changes made.

Add-in conversion completed (yay) - but until or if JetBrains get serious about supporting the addin community with up to date samples and some decent documentation I don't see myself bothering again in future. There is too little stability in the API interface across the last few versions of Resharper at least.

0

Please sign in to leave a comment.