Tuesday, September 11, 2007

Xml in VS with Resharper

In the early 2000-s XML was one of the technologies, wondered the developer community.

Today, with all of that RoR,JSON n etc. XML has become thing, that many people dislike. But also, it's for now sufficiently mature.

In this world (java/.net) today when it has no attribute/annotation use, xml is choose for configuration in most cases. So NHibernate or Spring use it.

Visual Studio has enough good support for XML (if you not forgot place your *.xsd in Schemas folder) - except one thing. When you want to create new mapping for class you need to manual write whole namespace for it.

And now, with ReSharper you can complete you class name in XML.

Just press Ctrl-Alt-Space. You see:

resharperxml1

And you get:

resharperxml2

 

But assembly name you need to add by hand:

resharperxml3

 

As Ilya Ryzhenkov mentioned in comments, ReSharper has context action for complete module qualification.

 resharperxml4

Click yellow light bulb or press Alt-Enter:

resharperxml5

And you'll give:

resharperxml6

It's almost cool, only what I want is ability to  add only assembly name, not full qualification.

2 comments:

  1. In fact, there should be context action (Alt-Enter) on type name in XML, to add assembly qualification. Doesn't it work for you?

    ReplyDelete
  2. ilya,

    yes, you're right, thanks, I'll update the post. Jokingly, that i've noticed yellow bulb but didn't try open it.

    ReplyDelete