Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Weird cproject and language settings reformatting issue
Weird cproject and language settings reformatting issue [message #1830537] Tue, 28 July 2020 18:47 Go to next message
John McCabe is currently offline John McCabeFriend
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 Go to previous messageGo to next message
David VavraFriend
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.
index.php/fa/38680/0/

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 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
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 #1830578 is a reply to message #1830565] Wed, 29 July 2020 11:10 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I doubt this file was meant to be human readable so its formatting is irrelevant.
There is an alternate, readable way to view it.
Why is it an issue?
Re: Weird cproject and language settings reformatting issue [message #1830583 is a reply to message #1830578] Wed, 29 July 2020 12:46 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
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 #1830590 is a reply to message #1830583] Wed, 29 July 2020 13:28 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
So then you are asking out of curiosity and
the file content is correct
so no one needs to devote any time to fixing a non-problem?
Re: Weird cproject and language settings reformatting issue [message #1830591 is a reply to message #1830590] Wed, 29 July 2020 13:38 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
David,

Again, while I appreciate you taking the time to read my questions, if you don't have a 'solution', please stop wasting my time and that of other people who've discovered the same 'problem' and would like to see it 'resolved'.


Re: Weird cproject and language settings reformatting issue [message #1830600 is a reply to message #1830591] Wed, 29 July 2020 14:55 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Apparently the answer to my question is: yes.
Just wanted to be sure.

I note the OP at stackoverflow said it wasn't a real problem
and his concern was version control.

Good luck!
Re: Weird cproject and language settings reformatting issue [message #1830602 is a reply to message #1830600] Wed, 29 July 2020 15:14 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
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 #1830604 is a reply to message #1830602] Wed, 29 July 2020 16:13 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Quote:
I have better things to do with my time than waste them on stupid responses like yours.

Yet ironically you did.

The purpose of this forum is to try to solve issues or supply a workaround.
It's not for general discussion.
Without a real issue you are engaging in a general discussion.

I provided a workaround which you have inexplicably rejected.
You seem more interested in complaining about my giving you one
or asking why it is insufficient.

Re: Weird cproject and language settings reformatting issue [message #1830605 is a reply to message #1830604] Wed, 29 July 2020 16:22 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Quote:
The purpose of this forum is to try to solve issues or supply a workaround.


Neither of which you have done. You clearly do not have a solution to the issue, so please, David, just go away and stop wasting my time.
Re: Weird cproject and language settings reformatting issue [message #1830914 is a reply to message #1830537] Thu, 06 August 2020 14:56 Go to previous messageGo to next message
David Abdallah is currently offline David AbdallahFriend
Messages: 3
Registered: August 2020
Junior Member
I, too, have recently experienced this same issue. It started immediately after I updated my Java runtime from jre-8u261 to the jdk-11 LTS release. No other changes were made to my Eclipse installation.

And to the useless poster who asked why we care? It interferes with revision control and when something unexpected like this happens, it's often a symptom of an undetected problem or bug. That's why I care.
Re: Weird cproject and language settings reformatting issue [message #1830918 is a reply to message #1830914] Thu, 06 August 2020 16:42 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4493
Registered: July 2009
Senior Member

So the question becomes how CDT is reading and writing the .cproject file, and why it's affected by the Java runtime version while seemingly nothing else is, right?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Weird cproject and language settings reformatting issue [message #1830920 is a reply to message #1830918] Thu, 06 August 2020 17:03 Go to previous messageGo to next message
David Abdallah is currently offline David AbdallahFriend
Messages: 3
Registered: August 2020
Junior Member
From my limited experimentation, that seems correct. Changing only the JRE version causes the issue to appear on my setup. Reverting the JRE makes the issue go away. I've added this information to the bug report that was filed on the issue.
Re: Weird cproject and language settings reformatting issue [message #1830924 is a reply to message #1830537] Thu, 06 August 2020 18:23 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Thank you David Abdallah and Nitin for those useful comments. I, too, had updated to JDK 11 (OpenJDK) as there were updates to Eclipse with CDT (Meson I think) that were refusing to install without it. It appears to be a compatibility issue, by the looks of it, but a very annoying one.

And, David Abdallah, thank you for your explanation on why it matters. Those were exactly my reasons, but I wasn't prepared to spend my time justifying those to someone who seems to think they know better than everyone else.
Re: Weird cproject and language settings reformatting issue [message #1830925 is a reply to message #1830537] Thu, 06 August 2020 18:41 Go to previous messageGo to next message
David Abdallah is currently offline David AbdallahFriend
Messages: 3
Registered: August 2020
Junior Member
Happy to contribute constructive comments that help move the issue forward. And thanks for starting this thread and creating the bug report!

[Updated on: Thu, 06 August 2020 18:42]

Report message to a moderator

Re: Weird cproject and language settings reformatting issue [message #1830931 is a reply to message #1830549] Thu, 06 August 2020 22:29 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4493
Registered: July 2009
Senior Member

I'd be remiss not pointing out that the bottom of the editor pane for the XML Editor lets you flip over to a tab showing the fully editable Source of the XML file. It'll return to the last tab you used the next time you open an XML File.

_
Nitin Dahyabhai
Eclipse Web Tools Platform

[Updated on: Thu, 06 August 2020 22:31]

Report message to a moderator

Re: Weird cproject and language settings reformatting issue [message #1830934 is a reply to message #1830931] Fri, 07 August 2020 00:00 Go to previous message
David VavraFriend
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

Previous Topic:Configuration product file for building new RCP IDE on the basis C/C++ IDE
Next Topic:Build might be incomplete
Goto Forum:
  


Current Time: Sun Oct 13 21:06:22 GMT 2024

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

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

Back to the top