SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Matt Ward

Go To XML Schema Definition

The XML Editor in SharpDevelop 2.1 now has Go To XML Schema Definition support. Open an XML document that uses a schema into SharpDevelop, move the cursor to the element or attribute, then either right click and select the menu option Goto Definition or press Ctrl+Enter. The schema will then be opened and the cursor will be positioned on the matching element or attribute definition.

Features

  • Go to element definition.
  • Go to attribute definition.
  • Go to attribute, element, attribute group and group references.
  • Go to referenced simple type, complex type.

Go To Element Definition

Move the cursor so it is on the element name inside its starting tag. Right click and select Goto Definition or press Ctrl+Enter.

Go to definition menu item

The schema will then be opened and the cursor moved to the element definition.

Wix Schema showing product element

Go To Attribute Definition

Move the cursor so it is inside or next to an attribute.

Cursor next to Wix document Product/@Id attribute

Go to definition takes you to the attribute definition.

Wix schema product/@Id displayed

Go To Element Reference

Inside the schema itself, move the cursor inside the ref attribute's value.

Cursor on WiX schema element ref

Go to definition takes you to the referenced element.

WiX Schema showing AppId element

Similarly you can click inside the ref attribute value for the elements xs:group, xs:attributeGroup, and xs:attribute, and go to their corresponding definitions.

Go To Element Type

Inside the schema, move the cursor inside the type attribute's value.

Cursor inside element type attribute.

Go to definition takes you to the corresponding complex type.

WiX schema with complex type displayed

Go To Attribute Type

Inside the schema again, move the cursor inside the type attribute's value.

Cursor inside type attribute's value.

Go to definition takes you to the type definition.

Wix schema simple type displayed

Navigating Back and Forward

Used in conjunction with the new Navigate BackNavigate Back toolbar button and Navigate ForwardNavigate forward toolbar button toolbar buttons, added by David Alpert, you can quickly jump back and forth around the schema.

Limitations

It only works with schemas that SharpDevelop is aware of. These can configured by selecting Options from the Tools menu, then selecting the Text Editor category and then XML Schemas.

SharpDevelop does not currently pick up any changes made to a schema without being restarted.

Published Aug 09 2006, 09:14 PM by MattWard
Filed under:

Comments

 

Rupepa said:

Matt,

Thank you, for one more tool!

I was wondering that you could put one more checkbox in Editor options panel allowing the user choose if he wants SD always bookmarks current line, before execute the "go to definition" command. Something like:

[ ] Automatic set bookmark before execute the "go to definition" command.

For those users that always use bookmarks to navigate, this option will be welcome!

Thank you.
August 10, 2006 1:26 AM
 

MattWard said:

I have added a feature request to the tracker:

http://bugtracker.sharpdevelop.net/Default.aspx?p=4&i=1006
August 10, 2006 12:48 PM
 

DavidAlpert said:

a similar functionality is now implemented via the Code Navigation History; doesn't automatically enter bookmarks, but does provide a fairly accurate "go back" function.

September 24, 2006 8:16 PM
 

Matt Ward said:

Here is the list of features that have been added to SharpDevelop 2.1. Feature Description Code Analysis

March 5, 2007 7:28 PM
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.