Skip to main content



      Home
Home » Newcomers » Newcomers » Why does Eclispe Reformat My Files?
Why does Eclispe Reformat My Files? [message #173362] Tue, 03 October 2006 11:02 Go to next message
Eclipse UserFriend
Originally posted by: hal.thresholddigital.com

I've had a similar problem that I've posted before with the Java Editor. (I
created my own definitions for code formatting and they're ignored when I
press ctrl-shift-f.) I have not had time to re-install Eclipse or file a
bug report on it. I could deal with that issue if Eclipse didn't just go
through an reformat my files while I'm editing.

I had just gone through and added blank lines, by hand, in front of every
method in my class, or in front of the Javadoc comment before that method.
For me, finally, the code was easily readable. Then I added a new method
to my class, in the middle, and below it, all the methods that were one
space apart, so I could easily read them and keep them separate, had been
moved together. The blank lines before the method declarations had been
removed in most, but not all cases.

This is not something done when I opened or closed a file, and it's an
ongoing problem. I understand the need to unfold a method when I'm editing
right above it. This is completely different, though. I can have the
class formatted the way I want, then I add a new method, and suddenly
everything below it is reformatted.

If ctrl-shift-f would reformat to my specs, or if this auto-reformatting
while I'm editing would stop, it'd be okay, but as it is, I have to keep
reformatting by hand when I get confused in reading the classes. Can I
turn off this obnoxious re-writing of my code? It's like Eclipse has it's
standards and won't listen to mine.

Thanks!

Hal
Re: Why does Eclispe Reformat My Files? [message #173434 is a reply to message #173362] Tue, 03 October 2006 21:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wayne.beaton._NOSPAM_eclipse.org

Hal Vaughan wrote:

> If ctrl-shift-f would reformat to my specs, or if this auto-reformatting
> while I'm editing would stop, it'd be okay, but as it is, I have to keep
> reformatting by hand when I get confused in reading the classes. Can I
> turn off this obnoxious re-writing of my code? It's like Eclipse has it's
> standards and won't listen to mine.


How is it reformatting while you're editing? Do you mean it's stripping
out extra lines and such from methods you're not even editing?

What version of Eclipse are you using?

Wayne
Re: Why does Eclispe Reformat My Files? [message #173442 is a reply to message #173434] Wed, 04 October 2006 01:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hal.thresholddigital.com

Wayne Beaton wrote:

> Hal Vaughan wrote:
>
>> If ctrl-shift-f would reformat to my specs, or if this auto-reformatting
>> while I'm editing would stop, it'd be okay, but as it is, I have to keep
>> reformatting by hand when I get confused in reading the classes. Can I
>> turn off this obnoxious re-writing of my code? It's like Eclipse has
>> it's standards and won't listen to mine.
>
>
> How is it reformatting while you're editing? Do you mean it's stripping
> out extra lines and such from methods you're not even editing?

I've had a number of times today where I've edited a class that has a blank
line after each method, followed either by another method or a Javadoc
comment and a method. I start editing a method and look below and find
that extra blank lines after (or before) methods have been inserted or the
blank lines that were there were removed.

I'm using either my format defs, which specify a blank line before methods,
or the default Java defs. This is in the Java editor.

All I have to do is do a little editing in one method, and all the ones that
follow get extra blank lines added between them or the blank lines between
following methods are removed.

> What version of Eclipse are you using?

OOps. Forgot to include it. Version 3.2 on Linux.

Hal
Re: Why does Eclispe Reformat My Files? [message #173490 is a reply to message #173442] Wed, 04 October 2006 09:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.gmail.com

It sounds to me like there's some confusion in the interpretation of the
newline characters going on in your file. Did you create this file from
scratch, or bring it on to you linux system from a windows or mac? Does
this problem happen with a new file you create from scratch? If you're
working on a Windows file on Linux, and don't use a system like CVS
which will handle the conversion automatically, you can go to
Window->Preferences->General->Workspace and change the New text file
line delimiter to Windows and see if that helps.

- Jeff

Hal Vaughan wrote:
> Wayne Beaton wrote:
>
>> Hal Vaughan wrote:
>>
>>> If ctrl-shift-f would reformat to my specs, or if this auto-reformatting
>>> while I'm editing would stop, it'd be okay, but as it is, I have to keep
>>> reformatting by hand when I get confused in reading the classes. Can I
>>> turn off this obnoxious re-writing of my code? It's like Eclipse has
>>> it's standards and won't listen to mine.
>>
>> How is it reformatting while you're editing? Do you mean it's stripping
>> out extra lines and such from methods you're not even editing?
>
> I've had a number of times today where I've edited a class that has a blank
> line after each method, followed either by another method or a Javadoc
> comment and a method. I start editing a method and look below and find
> that extra blank lines after (or before) methods have been inserted or the
> blank lines that were there were removed.
>
> I'm using either my format defs, which specify a blank line before methods,
> or the default Java defs. This is in the Java editor.
>
> All I have to do is do a little editing in one method, and all the ones that
> follow get extra blank lines added between them or the blank lines between
> following methods are removed.
>
>> What version of Eclipse are you using?
>
> OOps. Forgot to include it. Version 3.2 on Linux.
>
> Hal
>
Re: Why does Eclispe Reformat My Files? [message #173519 is a reply to message #173490] Wed, 04 October 2006 14:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hal.thresholddigital.com

Jeff Myers wrote:

> It sounds to me like there's some confusion in the interpretation of the
> newline characters going on in your file. Did you create this file from
> scratch, or bring it on to you linux system from a windows or mac? Does
> this problem happen with a new file you create from scratch? If you're
> working on a Windows file on Linux, and don't use a system like CVS
> which will handle the conversion automatically, you can go to
> Window->Preferences->General->Workspace and change the New text file
> line delimiter to Windows and see if that helps.
>
> - Jeff

The file was created from scratch. It's not a problem of when the file is
read in. The problem is not on loading or saving, but what happens WHILE I
am editing in the Java editor.

There should be no problem with EOL characters, since Eclipse and the files
have been on Linux from the start.

Hal



> Hal Vaughan wrote:
>> Wayne Beaton wrote:
>>
>>> Hal Vaughan wrote:
>>>
>>>> If ctrl-shift-f would reformat to my specs, or if this
>>>> auto-reformatting while I'm editing would stop, it'd be okay, but as it
>>>> is, I have to keep
>>>> reformatting by hand when I get confused in reading the classes. Can I
>>>> turn off this obnoxious re-writing of my code? It's like Eclipse has
>>>> it's standards and won't listen to mine.
>>>
>>> How is it reformatting while you're editing? Do you mean it's stripping
>>> out extra lines and such from methods you're not even editing?
>>
>> I've had a number of times today where I've edited a class that has a
>> blank line after each method, followed either by another method or a
>> Javadoc
>> comment and a method. I start editing a method and look below and find
>> that extra blank lines after (or before) methods have been inserted or
>> the blank lines that were there were removed.
>>
>> I'm using either my format defs, which specify a blank line before
>> methods,
>> or the default Java defs. This is in the Java editor.
>>
>> All I have to do is do a little editing in one method, and all the ones
>> that follow get extra blank lines added between them or the blank lines
>> between following methods are removed.
>>
>>> What version of Eclipse are you using?
>>
>> OOps. Forgot to include it. Version 3.2 on Linux.
>>
>> Hal
>>
Re: Why does Eclispe Reformat My Files? [message #174020 is a reply to message #173519] Mon, 09 October 2006 12:04 Go to previous message
Eclipse UserFriend
Hal Vaughan wrote:

>Jeff Myers wrote:
>
>
>
>>It sounds to me like there's some confusion in the interpretation of the
>>newline characters going on in your file. Did you create this file from
>>scratch, or bring it on to you linux system from a windows or mac? Does
>>this problem happen with a new file you create from scratch? If you're
>>working on a Windows file on Linux, and don't use a system like CVS
>>which will handle the conversion automatically, you can go to
>>Window->Preferences->General->Workspace and change the New text file
>>line delimiter to Windows and see if that helps.
>>
>> - Jeff
>>
>>
>
>The file was created from scratch. It's not a problem of when the file is
>read in. The problem is not on loading or saving, but what happens WHILE I
>am editing in the Java editor.
>
>There should be no problem with EOL characters, since Eclipse and the files
>have been on Linux from the start.
>
>
Please file a bug report against JDT Text with steps to reproduce.

Dani

>Hal
>
>
>
>
>
>>Hal Vaughan wrote:
>>
>>
>>>Wayne Beaton wrote:
>>>
>>>
>>>
>>>>Hal Vaughan wrote:
>>>>
>>>>
>>>>
>>>>>If ctrl-shift-f would reformat to my specs, or if this
>>>>>auto-reformatting while I'm editing would stop, it'd be okay, but as it
>>>>>is, I have to keep
>>>>>reformatting by hand when I get confused in reading the classes. Can I
>>>>>turn off this obnoxious re-writing of my code? It's like Eclipse has
>>>>>it's standards and won't listen to mine.
>>>>>
>>>>>
>>>>How is it reformatting while you're editing? Do you mean it's stripping
>>>>out extra lines and such from methods you're not even editing?
>>>>
>>>>
>>>I've had a number of times today where I've edited a class that has a
>>>blank line after each method, followed either by another method or a
>>>Javadoc
>>>comment and a method. I start editing a method and look below and find
>>>that extra blank lines after (or before) methods have been inserted or
>>>the blank lines that were there were removed.
>>>
>>>I'm using either my format defs, which specify a blank line before
>>>methods,
>>>or the default Java defs. This is in the Java editor.
>>>
>>>All I have to do is do a little editing in one method, and all the ones
>>>that follow get extra blank lines added between them or the blank lines
>>>between following methods are removed.
>>>
>>>
>>>
>>>>What version of Eclipse are you using?
>>>>
>>>>
>>>OOps. Forgot to include it. Version 3.2 on Linux.
>>>
>>>Hal
>>>
>>>
>>>
>
>
>
Previous Topic:error executing jar file
Next Topic:Eclipse 3.2 and introspection
Goto Forum:
  


Current Time: Mon May 12 19:49:20 EDT 2025

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

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

Back to the top