Weird cproject and language settings reformatting issue [message #1830537] |
Tue, 28 July 2020 18:47 |
John McCabe Messages: 228 Registered: July 2009 |
Senior Member |
|
|
I've been working with Eclipse 2020-06 for a while. I originally used the Eclipse installer to install the C/C++ IDE at 2019-06 and have updated it as time's passed. I somehow managed to screw up that installation today, so made a clean install of 2020-06. However I've now found that my language.settings.xml files are being modified weirdly but, more importantly, the same is happening to my .cproject files.
Essentially all the indentation is being changed; where previously only tabs were used, it seems like Eclipse has put a newline after the tabs (that were already there), then re-indented the settings line using spaces.
Has anyone else come across this? If so, is there a way to make it go back to how it was before? Alternatively, does anyone know whether, if I took the lines of only tabs out, it would work OK and not have the tabs put back in on the next change?
I found someone else with the same issue at https://stackoverflow.com/questions/57715522/eclipse-cproject-file-no-longer-indents-with-tabs-but-now-with-spaces, but there's no answer to getting it back to how it was there.
Thanks for any useful suggestions.
John
|
|
|
Re: Weird cproject and language settings reformatting issue [message #1830549 is a reply to message #1830537] |
Wed, 29 July 2020 03:19 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
I am currently using 2020-06 for some projects and haven't encountered anything strange.
Might be helpful if you could show an example of what you mean.
It really isn't clear what the OP at stackoverflow actually meant.
On the surface, he appears to be referring to the editor displays.
So the first answer is a good one despite being downvoted.
The OP however seems to be talking about the formatting of the .cproject files themselves.
Not sure why he cares.
So what indentations are you talking about?
If you mean the content of the .cproject files, why do you care?
You can view it with the Eclipse XML editor.
That editor shows the content as a tree.
Here's a sample.
If you instead mean the indentation of the editor displays
then do check the formatting and also check the tab settings
under Window --> Preferences --> Text Editors
[Updated on: Wed, 29 July 2020 03:25] Report message to a moderator
|
|
|
Re: Weird cproject and language settings reformatting issue [message #1830565 is a reply to message #1830549] |
Wed, 29 July 2020 08:57 |
John McCabe Messages: 228 Registered: July 2009 |
Senior Member |
|
|
David Vavra wrote on Tue, 28 July 2020 23:19
Might be helpful if you could show an example of what you mean.
Here you go, see the attached image. That shows the before and after of a .cproject file. As you can see,:
1) the 1 tab in the cproject on the left has been replaced by 4 spaces, followed by 1 tab, followed by 1 newline, followed by 4 more spaces.
2) 2 tabs on the left becomes 8 spaces, followed by 2 tabs, followed by 1 newline, followed by 8 more spaces
3) 3 tabs on the left becomes 12 spaces, followed by 3 tabs, followed by 1 newline, followed by 12 more spaces
and so on.
If you know why this is, or whether there's a way to avoid this mangling, feel free to reply.
With all due respect, please don't reply if you're only going to ask why I care; that is irrelevant and doesn't add to the discussion.
|
|
|
|
Re: Weird cproject and language settings reformatting issue [message #1830583 is a reply to message #1830578] |
Wed, 29 July 2020 12:46 |
John McCabe Messages: 228 Registered: July 2009 |
Senior Member |
|
|
Sorry David,
At the risk of alienating everyone, while I don't want to appear unappreciative of you taking the time to read and respond, nor to put anyone else off providing useful information, your answer comes under the category described in the last paragraph of my previous message where I said:
Quote:"With all due respect, please don't reply if you're only going to ask why I care; that is irrelevant and doesn't add to the discussion.".
It's taken you time to write that message, and it's taken me a good 5 minutes to consider my wording in a way that tries not to be offensive, and to reply, but it hasn't added any value for either of us, not for any other Eclipse users.
John
|
|
|
|
|
|
Re: Weird cproject and language settings reformatting issue [message #1830602 is a reply to message #1830600] |
Wed, 29 July 2020 15:14 |
John McCabe Messages: 228 Registered: July 2009 |
Senior Member |
|
|
David,
While I don't wish for this to be rude, I have better things to do with my time than waste them on stupid responses like yours.
At some point in the future, someone else might come on here with exactly the same question as I had, find this thread and, as I've done on numerous occasions, feel dejected because, despite there being n replies which suggest they have a decent chance of finding an answer, all they've got is you stringing the thread along while not providing anything of value.
Perhaps you've even had the same experience; how do you feel when you're seeking an answer to a question and all someone can do is question your motives for wanting an answer?
Please, if anyone knows either a solution to this issue, or a reason why it's happening, your input to this would be very much appreciated however, David, I feel you really must have better things to do with your time too so, if you have neither a solution nor a reason, please just go away.
|
|
|
|
|
|
|
|
|
|
|
Re: Weird cproject and language settings reformatting issue [message #1830934 is a reply to message #1830931] |
Fri, 07 August 2020 00:00 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
https://www.eclipse.org/forums/index.php?t=msg&th=1104680&goto=1830914&#msg_1830914
Quote:And to the useless poster who asked why we care?
I notice you joined this forum just today.
It's odd that you would say this as I only asked that of one person and that was over a week ago.
The reason I asked was to get an idea of why it would be a problem at all with a language that doesn't care about formatting.
Reading the file with a plain vanilla text editor would be more difficult.
To that, I suggested the XML Editor which would avoid the difficulty.
Quote:It interferes with revision control
Yes it can cause unnecessary version control commits but no more so than someone converting spaces to tabs or vice versa or adding extra lines.
There are switches in most version controls to avoid this.
I can only wonder why one wouldn't take advantage of them.
There are some languages where formatting is important but XML isn't one of them.
In 50 years, I've ignored spaces in diffs with all but a few languages.
Quote:when something unexpected like this happens, it's often a symptom of an undetected problem or bug
So then it hasn't actually caused a problem and there is no pressing issue that requires a fix?
Glad to hear it.
[Updated on: Fri, 07 August 2020 02:43] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04339 seconds