Monday, 23 April 2007

XAML Support in Resharper 3.0

I am an avid Jetbrains Resharper user and have been for years, I really think it increases the usability of Visual Studio above and beyond that provided by Microsoft. I regularly return to their site to check on the new releases and see what they're working on, and just noticed that they have started adding some support for XAML to their latest EAP Release. So having installed it and opened my solution, I open a XAML file to see what has happened. You can immediately see that Resharper is having an effect because things show up in completely different colours - there seems to be some processing happening on every tag in the XAML file (this processing all happens in the background so doesn't slow things down very much). So, now type names show up in blue and property names show up in purple. This is consistent with the rest of Resharpers colourings, although these are of course configurable. When you have the keyboard over a tag, there are now two context sensitive options, these are "Replace all tags" and "Replace all attributes". I think this just comes from the new changes they have made for XML refactoring and aren't hugely useful for XAML. It might be useful if you want to replace all TextBoxes with say, Labels or something, or if you rename a property on a type and want all references to be renamed (although I imagine this will eventually happen automatically). The only truly useful feature I can find simply comes from the fact that references are being resolved, so the existing Resharper feature of "Go To Definition (Ctrl+B) can be used on them. So you can now press Ctrl+B on any property or object name and get instantly taken to the definition of that. This is great for Styles and other resources (e.g. where you have Style="{StaticResource MyStyle}" you can navigate straight to the style) and using it on anything else seems to take you to the object browser for that type or property (previously you would just get taken to relevant line in the XmlPresentation.xsd file). That's about it really - overall I can't see much extra that this is adding to the XAML user experience, but I can see, by programatically resolving references that they are laying the groundworks for some very useful features. However there is still a lot to do on this subject - for example, open any complex XAML file and the first thing you will notice if you are using any custom namespaces or custom controls, is that Resharper is not picking them up. They do state on their site that they are working on improving this.

No comments: