Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Re: Ident, not Format, in XML files
Re: Ident, not Format, in XML files [message #229219] Thu, 19 March 2009 10:22 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26215
Registered: July 2009
Senior Member
Raul,

I don't have WTP installed, but I wonder if there are formatting
preferences such that you can tell it not to break long lines... Have
you looked at the preferences for this?

It might be better to ask this question on the web tools newsgroups, so
I've added it to the "to" list of the reply.


Raul Acevedo wrote:
> Is there a way to get Eclipse to ONLY indent a line in XML files?
>
> Ctrl-I is bound to "Format Active Elements", and I don't see any
> commands that will simply indent the current line.
>
> Raul Acevedo
> http://www.cantara.com
>
Re: Ident, not Format, in XML files [message #229272 is a reply to message #229219] Thu, 19 March 2009 18:17 Go to previous messageGo to next message
Raul Acevedo is currently offline Raul AcevedoFriend
Messages: 18
Registered: July 2009
Junior Member
I've tried every option, plus key bindings, to make this happen but it
just doesn't.

Is there a way to make the XML editor only indent without screwing up the
entire line, or should I just file a bug for this?

Thanks,

Raul Acevedo
http://www.cantara.com
Re: Ident, not Format, in XML files [message #229279 is a reply to message #229272] Thu, 19 March 2009 18:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

Select the line you want to format, then press CTRL+SHFT+F

If you have multiple lines, you want to format, select them and do the
same thing.

Dave


Raul Acevedo wrote:
> I've tried every option, plus key bindings, to make this happen but it
> just doesn't.
>
> Is there a way to make the XML editor only indent without screwing up
> the entire line, or should I just file a bug for this?
>
> Thanks,
>
> Raul Acevedo
> http://www.cantara.com
>
Re: Ident, not Format, in XML files [message #229287 is a reply to message #229279] Thu, 19 March 2009 22:40 Go to previous messageGo to next message
Raul Acevedo is currently offline Raul AcevedoFriend
Messages: 18
Registered: July 2009
Junior Member
As I said...

I do NOT want to "format" the lines. I don't want Eclipse to touch
ANYTHING excepth the line indentation ONLY. Formatting the lines may
split a single line into multiple lines, which I do not want.

I.e. the equivalent of Ctrl-I in a Java editor. Ctrl-I in a Java editor
doesn't reformat your entire line, it only corrects the indentation of the
line.

Thanks,

Raul
Re: Ident, not Format, in XML files [message #229293 is a reply to message #229287] Thu, 19 March 2009 22:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26215
Registered: July 2009
Senior Member
Raul,

I'm stuck by the following thought: surely if a tool is going to split
lines, it will give one the ability to control the line width. Assuming
that's true, one could set the line width to a really large number such
that lines would not be broken at all. I wonder where the flaw in my
thinking lies?


Raul Acevedo wrote:
> As I said...
>
> I do NOT want to "format" the lines. I don't want Eclipse to touch
> ANYTHING excepth the line indentation ONLY. Formatting the lines may
> split a single line into multiple lines, which I do not want.
>
> I.e. the equivalent of Ctrl-I in a Java editor. Ctrl-I in a Java
> editor doesn't reformat your entire line, it only corrects the
> indentation of the line.
>
> Thanks,
>
> Raul
>
Re: Ident, not Format, in XML files [message #229311 is a reply to message #229293] Fri, 20 March 2009 03:19 Go to previous messageGo to next message
Raul Acevedo is currently offline Raul AcevedoFriend
Messages: 18
Registered: July 2009
Junior Member
The flaw in your thinking is that it doesn't work. :)

The first thing I tried was setting the line width in Preferences -> XML
-> XML Files -> Editor. The problem is that the format command doesn't
just listen to the line length; it insists on putting every new tag on its
own line. So for example if I have:

<property name="foo"><map/></property>

Which I really, really want to keep on one line, it changes that to:

<property name="foo">
<map/>
</property>

Which I really, really do NOT want. All I want is for it to indent the
damn line and leave tags where I put them.

Raul
Re: Ident, not Format, in XML files [message #229321 is a reply to message #229311] Fri, 20 March 2009 10:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26215
Registered: July 2009
Senior Member
Raul,

Now with an example it's becoming more clear. So you don't want it to
introduce any new line breaks even to achieve "properly indented tags."
Given it doesn't do that, you could enter a feature request, but it's
likely to sit around for a long time unless someone like you not only
wants something but is willing to do something about it too...

Then again David Carver can be a bit fanatic. :-P



Raul Acevedo wrote:
> The flaw in your thinking is that it doesn't work. :)
>
> The first thing I tried was setting the line width in Preferences ->
> XML -> XML Files -> Editor. The problem is that the format command
> doesn't just listen to the line length; it insists on putting every
> new tag on its own line. So for example if I have:
>
> <property name="foo"><map/></property>
>
> Which I really, really want to keep on one line, it changes that to:
>
> <property name="foo">
> <map/>
> </property>
>
> Which I really, really do NOT want. All I want is for it to indent
> the damn line and leave tags where I put them.
>
> Raul
>
Re: Ident, not Format, in XML files [message #229346 is a reply to message #229321] Fri, 20 March 2009 17:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

Ed Merks wrote:
> Raul,
>
> Now with an example it's becoming more clear. So you don't want it to
> introduce any new line breaks even to achieve "properly indented tags."
> Given it doesn't do that, you could enter a feature request, but it's
> likely to sit around for a long time unless someone like you not only
> wants something but is willing to do something about it too...
> Then again David Carver can be a bit fanatic. :-P

What me? I prefer zealot, instead. :)

As a fyi to the community in general, we are discussing formatting
issues and use cases during eclipsecon, so hopefully we can get this
working better for all stake holders in the future.

Dave
Re: Ident, not Format, in XML files [message #229354 is a reply to message #229346] Fri, 20 March 2009 17:37 Go to previous messageGo to next message
Raul Acevedo is currently offline Raul AcevedoFriend
Messages: 18
Registered: July 2009
Junior Member
I filed a feature request for this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=269556

David, do you know if this would be simple to do? I assume it wouldn't be
difficult because the existing Format command already knows how to do
this, it would be a matter of writing a new Indent Line command that only
does the line indentation part.

Thanks,

Raul
Re: Ident, not Format, in XML files [message #229361 is a reply to message #229354] Fri, 20 March 2009 18:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

On the surface it doesn't seem difficult, but won't know until we get
into it.

Dave

Raul Acevedo wrote:
> I filed a feature request for this:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=269556
>
> David, do you know if this would be simple to do? I assume it wouldn't
> be difficult because the existing Format command already knows how to do
> this, it would be a matter of writing a new Indent Line command that
> only does the line indentation part.
>
> Thanks,
>
> Raul
>
Re: Ident, not Format, in XML files [message #229368 is a reply to message #229361] Fri, 20 March 2009 22:26 Go to previous message
Raul Acevedo is currently offline Raul AcevedoFriend
Messages: 18
Registered: July 2009
Junior Member
Understood. Thank you!

Raul
Previous Topic:Server startup warning in 3.4.1
Next Topic:Generic Server External Launcher requierements
Goto Forum:
  


Current Time: Sun Nov 23 12:33:02 GMT 2014

Powered by FUDForum. Page generated in 0.02726 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software