[MonoDevelop] XML Entity Completion Patch

"Andrés G. Aragoneses" knocte at gmail.com
Sun Dec 14 15:19:42 EST 2008


David A Knight wrote:
> 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.  

Hey, cool feature, but yes, I agree this should be off by default in
order not to confuse users.


> 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

There are a lot more cases besides &quot;, what about &amp; or any
accentuated letter? What I would like to suggest is to convert this kind
of things by demand, for example giving an option when right clicking on
them. And, after being converted by the user, it would be interesting to
still show the original (I mean, the final) character in the tooltip
when hovering the mouse on it.


> 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
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list



More information about the Monodevelop-list mailing list