tab-distance as a project or file parameter? [message #151644] |
Tue, 30 March 2004 11:01  |
Eclipse User |
|
|
|
Hi all,
I did a quick search in Bugzilla re. "tab-distance" (and misc.
variants of it) and found nothing so I don't know whether this subject
has already been discussed (and maybe has already once been beaten to
death...). If not, I would like to spark some discussion whether this
would be a worthwhile feature that I should enter as a feature request
or not:
I recently relatively often encountered the problem (well, problem is
to maybe much - the annoyance) that when I imported somebody else's
code that this code at first looks completely mis-formatted until I
realize that I again need to adjust the tab-distance (I myself am
using 4) to some other value (usually 8) to have the code decently
displayed.
However, when I do so, when I then switch back to one of my own files
then they in turn look ugly and I have to re-adjust that setting again
(unless I reformat all foreign files, but of course one usually tries
to avoid that for misc. reasons). So I was wondering, whether the
tab-distance - instead of being a global setting - should not better
be a project specific parameter or - taking this idea further - maybe
even a file-specific one (that one can pass on e.g. by entering some
special "hint to the editor" in the sourcecode e.g. somewhere near the
file header or in the first Javadoc comment or similar).
Would this be a major problem to implement in the eclipse sourcecode
editor? Do people have major objections against something like this?
What would be the preferred "granularity" of such a parameter
(project, package, file, other...)? Or has somebody maybe already
written such an extension?
Michael
|
|
|
Re: tab-distance as a project or file parameter? [message #151652 is a reply to message #151644] |
Tue, 30 March 2004 11:33  |
Eclipse User |
|
|
|
Of course this whole discussion could be spared, if people would
standardize on my way of doing things: :-)
At the line begin up to the current indentation level fill up with
tabs and anything that goes beyond it, fill up with blanks. This way -
even changing the tab-distance - the code looks always nice and pretty
(and everybody can use his/her preferred tab-distance), even when
nicely aligning multi-line method parameters or array-initializers,
etc.
And of course this also requires a well-behaved IDE or sourcecode
editor: it MUST NOT blindly replace all leading blanks with tabs, but
only (if at all) up to the current indentation level!
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.07073 seconds