XML editor - when opening tag is modified, modify closing tag right away ?

In XMl editor let's say I have a pair of opening/closing tags like ...]]>.

If I start modifying the opening tag from "something" to "SomethingElse" - the closing tags needs to be modified as well, of course.
What if IDEA was doing it automatically ? :)

5 comments
Comment actions Permalink

What's wrong with simply hitting Shift+F6 before modifying one of the tags (or accepting the quickfix for the "Wrong XML closing tag" inspection)?

Best regards,
Jens

0
Comment actions Permalink

.

Edited by: Evgeny Goldin on Apr 7, 2008 2:24 PM

0
Comment actions Permalink

Nothing. Both of them are just fine. As well as many other workarounds that surely exist for lot's of features that IDEA allows.
But when it's done automatically (I mean, there's no way you wouldn't want to change the closing tag if you've started changing the opening one) - it's just less typing :)

0
Comment actions Permalink

IMHO it's just not in line with Idea's spirit.
Probably there's a 1% chance that I really only wanted to modify the opening tag (and for example insert a closing tag right behind it and delete the old closing tag later).
Somebody else recently suggested to be able to cut (ctrl-x) an empty line and have Idea automatically not copy the line, because of course absolutely nobody would want empty
lines in their clipboard history.
Take about a hundred of these "it looks like your writing a letter" mis-features and for almost everybody Idea will constantly behave annoyingly.
For example take a "feature" that earlier Netbeans version had: IIRC you started to edit a method name and when the caret left the name, a dialog popped up asking if you want to
refactor usages of the method.
Another example is a feature that Idea included for a couple of EAP builds before it was removed again: When converting text to upper or lower case Idea automagically changed
camelCase words to CAMEL_CASE. Understandably some users who changed the case of sql queries in this way were annoyed to see their queries breaking at runtime.

Usually I am all for supporting the way the user works, but in this case it is really better to educate users a little and make them aware that for example editing an identifier is
much different from refactor-renaming a method.

Evgeny Goldin wrote:

Nothing. Both of them are just fine. As well as many other workarounds that surely exist for lot's of features that IDEA allows.
But when it's done automatically (I mean, there's no way you wouldn't want to change the closing tag if you've started changing the opening one) - it's just less typing :)

0
Comment actions Permalink

Ok, that sounds reasonable as well. Auto-correcting code (or auto-doing anything) always has a chance of annoying the one who didn't intend that at all ..
The question is "Developer modifying an opening XML tag - what does he mean by doing that ?"

I don't mind accepting a Quick Fix, of course. Manual refactoring indeed seems to be a better way than an automatic one.
IDEA may provide this as a choice - auto-refactor or not.

0

Please sign in to leave a comment.