ForTea 1.1.1 for ReSharper 8 is out

2013/07/19 13 comments

JetBrains just released ReSharper 8: check it out, it has a number of nice new or improved features, especially if you’re using XAML on a day-to-day basis!

In the same time, I’ve just released a new version of ForTea: 1.1.1. ForTea is a ReSharper plugin I’ve developed on my spare time, that adds support for editing T4 text template files (those with a .tt extension) that are commonly used in Entity Framework in particular, and generally whenever you need to generate files at compile time in Visual Studio. The first version has been out for a while, and you can read a great introduction about it here. This new version primarily adds support for ReSharper 8, and fixes some bugs. You can install it using the new ReSharper extension manager.

Categories: Uncategorized Tags:

ReSharper 7.1 provides XAML auto-completion

2012/10/08 No comments

ReSharper 7.1 EAP now provides built-in auto-completion in XAML files, as well as synchronous change of matching tags (for example, editing the name of an opening XML tag automatically changes the closing tag) and other niceties such as auto-removing a closing tag when you add a / to the matching opening tag.

You can now ditch GammaXaml! In fact, don’t. I’ll keep it updated with more XAML refactorings, context actions and Caliburn.Micro support. Still, it’s the only piece of software I ever wrote that naturally loses features over time because they aren’t necessary anymore. In this case, that’s a great thing: the more sweet features the ReSharper core has, the more people can benefit from them. Thanks, JetBrains.

Try the EAP! Remember there are only nightly builds for now, although they seem to run pretty fine.

Disable expanding file contents in Visual Studio 2012 Solution Explorer

2012/08/22 11 comments

In Visual Studio 2012, the files in Solution Explorer are expandable, allowing the user to navigate to the symbols they contain:

Visual Studio 2012 Solution Explorer with expandable files

While this can be convenient, I personally never use the Solution Explorer to navigate the code symbols: I prefer using Resharper Go To Type/Symbol and the File Structure Window, or Visual Studio Navigate To and VS Code Map. When using the Solution Explorer, I usually want to rename, delete or create a new file. Having expandable files makes the folders and projects harder to distinguish, so I searched for a way to disable this feature.

After Googling to no avail, I finally found an hidden setting that can be set in the registry.
Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0 and add a new dword value named UseSolutionNavigatorGraphProvider with a value of 0. Restart Visual Studio and enjoy your old-school Solution Explorer:

Visual Studio 2012 Solution Explorer without expandable files

You can also directly apply this registry file: VS2012NoFileExpand

Categories: Coding Tags:

Responsive XAML editing with ReSharper

2012/08/12 1 comment

Working with XAML files in Visual Studio can quickly become a pain on medium to large projects. Even with a decent machine, loading and editing XAML documents can feel very sluggish. There are several things that can be done to make the overall experience better.

Loading faster

If you’re never using the visual WPF designer, make sure it never loads. I’m not simply talking about enabling the option “Always open XAML documents in full view” here. Even if that helps by reducing document opening times a bit, some designer components are still loaded, and there is still room for improvement. The simplest way to never load the designer is to right click on any XAML document in the solution explorer, choose “Open with”, select “Source Code (Text) Editor” and click on “Set as default”. There won’t be XAML/Design tabs anymore in the editor and your documents should open fast.

Visual Studio Open With Dialog

Editing faster

Now that your documents are loading fast, you may want to edit them fast as well. In certain cases, the built-in IntelliSense for XAML is just slow, and happens to run on the main thread, making the overall typing experience quite bad. You can see below a dotTrace performance snapshot of five characters being typed inside a {x:Type} markup element, which is where I usually experience extreme sluggishness.

Slow XAML Completion

More than two seconds for the five keystrokes are being spent on completing the current statement. Even considering the overhead added by the profiler, that’s still not a smooth experience since this function runs on the main UI thread. What can we do then? Turn off auto-completion! Don’t worry, we’re going to replace it soon.

If you ever wandered into Visual Studio completion options for various languages, you may have noticed that the checkbox “Auto list members” is disabled for XAML and thus cannot be unchecked. There are registry solutions to disable it, as seen on this Stack Overflow post. However, as strange as it may seem, the call stack is still the same and the slow performance doesn’t disappear even with the auto listing disabled!

In Visual Studio 2010, IntelliSense appears to still be working, even if no completion list is shown. We have to turn it off at the core. Close all Visual Studio instances, then open the registry at HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\10.0\Languages\Language Services\XAML (don’t forget to remove Wow6432 if you’re not using a 64 bit OS) and change the dword value CodeSense from 1 to 0. You can also use the reg files provided at the bottom of this post to quickly enable or disable XAML IntelliSense in Visual Studio 2010. Be aware that this modification is done at the machine level, and will impact all local users.

In Visual Studio 2012, following the instructions on the Stack Overflow post seems to suffice to disable built-in IntelliSense.

Open Visual Studio: XAML editing should now be fast. But fast without any auto-completion is pretty meaningless. That’s where ReSharper kicks in. In version 6 and the newly released version 7, it provides advanced XAML completion, including data context completion in bindings and other niceties. The downside of this is that it’s currently shown only on demand by using Ctrl+Space. That’s partly why I developed GammaXaml, a ReSharper plugin that improves XAML editing in general, and exposes ReSharper on demand completion as automatic, on typing completion. Simply install the plugin and you’re done. You can now enjoy a pretty fluid editing experience.

Attachment : ChangeXamlIntelliSense.zip