Request: Being able to format a read-only file on screen

I have grown accustomed to look at code using a specific formatting scheme. Often when browsing jarred readyonly code, I am interupted with that I must use a lot of energy and focus to intutively understand the code I am looking at, so I have developed using this specific scheme, or simply a way to expect where things are.

Now, when I look at these readonly files I cannot do a code format, even though it is there in front of me (on the screen, in memory..?)

Why not enable code formatting on readonly files? When I close the window, its gone, and thats ok, since its only for me to press F4->ENTER when I want it back...

8 comments
Comment actions Permalink

That is a great idea, Chris. It cannot be particularly hard for IDEA to offer a new setting that optionally formats code automatically when files are opened even if they are opened as read-only.

Have you entered a request for this feature?

Best regards,
Lars Ugleberg

0
Comment actions Permalink

Excellent idea.

In fact, it would be nice if there was an option to always format read-only
files prior to displaying them in the editor.

The only issue that I see with this is in debugging: line numbers would be
all out of whack. But if there is a reasonable way to work around this
issue without slowing down debugging, I'm all for it.

Tim

"Chris Patrick Schreiner" <no_mail@jetbrains.com> wrote in message
news:8585908.1074776853684.JavaMail.itn@is.intellij.net...

I have grown accustomed to look at code using a specific formatting

scheme. Often when browsing jarred readyonly code, I am interupted with that
I must use a lot of energy and focus to intutively understand the code I am
looking at, so I have developed using this specific scheme, or simply a way
to expect where things are.
>

Now, when I look at these readonly files I cannot do a code format, even

though it is there in front of me (on the screen, in memory..?)
>

Why not enable code formatting on readonly files? When I close the window,

its gone, and thats ok, since its only for me to press F4->ENTER when I want
it back...


0
Comment actions Permalink

File a request about that - you will get my support.

0
Comment actions Permalink

Tracker Request # 27430

Thank you for your attention

0
Comment actions Permalink

Good idea, but I see problems in case of debugging. Imagine you debug
into JDK classes and a layout code of the read-only JDK sources has
scrambled the line numbers to useless positions. Where the debugger
should position?

--
Lars Köhler

0
Comment actions Permalink

Yes, I understand, but this has already been pointed out by Tim Haley, and by the way, Why would you make things more troublesome for yourself? Just a thought...

All the best

0
Comment actions Permalink

That is a great idea, Chris. It cannot be particularly hard for IDEA to

offer a new setting that optionally formats code automatically when files
are opened even if they are opened as read-only.

An extension of that idea would be to use a specific formatting when
loading up a file, and use a potentially different formatting when saving
the file.

That way, developers in a large project could have IDEA automatically
convert the formatting between what the developer is used to work
with and what the project standard is.

Vince.


0

Please sign in to leave a comment.