[MonoDevelop] XML Entity Completion Patch

David A Knight david at ritter.demon.co.uk
Sun Dec 14 11:13:22 EST 2008


The attached patch is a first shot at implementing auto completion of
entities in xml documents.

1) Typing "&" will result in "&;" being inserted and the cursor being
placed between the two chars.

2) If the cursor is between "&;" and the pressed key isn't a control
character, or a "#" then the entity will be expanded automatically, e.g.
typing € will result in the text becoming "€"


The default setting is for this to be turned off.  

To be more robust it probably should be checking if it is in a CDATA
section or <% %> etc.

There is a downside with html documents.  If you want to type &quot; for
example you will end up with &#113; if q is typed.  A possible solution
for this would be to only do the auto insertion if the character value
is > 127 or if it is a special char, <,>,",', &

There is no auto mapping to the standard xml named entities, e.g. <
doesn't become &lt; etc.



David


-------------- next part --------------
A non-text attachment was scrubbed...
Name: xml-entities.patch
Type: text/x-patch
Size: 10691 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20081214/332a9f04/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20081214/332a9f04/attachment-0001.bin 


More information about the Monodevelop-list mailing list