eclipse-platform / .github

Common contribution content for eclipse-platform repositories
https://www.eclipse.org/eclipse/
5 stars 10 forks source link

Manually selected file encoding resets itself to default #81

Closed bvg67 closed 1 year ago

bvg67 commented 1 year ago

Report for Eclipse 2022-12 on Rocky Linux 9.1

It seems that the previous manually selected "text encoding" value is lost between sessions.

Steps to reproduce:

I noticed that this "Resetting to Default" behavior sometimes happens directly when opening the "Preferences" dialog box after restarting Eclipse.

I also noticed that the "encoding=xxxxx" line in the "./.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs" file of the workspace disappears as soon as the value is reset in the dialog box.

iloveeclipse commented 1 year ago

I can't reproduce. Are you using Oomph? This would restore whatever user settings you had.

merks commented 1 year ago

If Oomph is involved the Error log will contain an informational message like this:

Setup tasks were performed during startup updating 36 preferences.See 'D:\Users\merks\emf-2.31\eclipse\configuration\org.eclipse.oomph.setup\setup.log' for details

Navigate -> Open Setup Log will show more details. E.g., \

[2022-12-21 14:51:51] Performing Preference /instance/org.eclipse.oomph.setup.ui/showToolBarContributions = true

And if you don't want that to happen, either record the preference they way you want it using this button when changing the value:

image

Or, use Navigate -> Open Setup -> User and remove settings you don't want:

image

Please let us know if this addresses the issue you see.

bvg67 commented 1 year ago

Here is the extract of setup.log corresponding to running an Eclipse session:

[2022-12-20 20:12:14] Executing startup tasks [2022-12-20 20:12:14] OpenJDK Runtime Environment 17.0.5+8-LTS [2022-12-20 20:12:14] Product org.eclipse.products.epp.package.java.2022-12 [2022-12-20 20:12:14] Workspace /home/xxxxx/workspace_bug [2022-12-20 20:12:14] Bundle org.eclipse.oomph.setup 1.25.0.v20220914-1119, build=5729, branch=e3a48095495b13551e05eca4aaee5945806274ab [2022-12-20 20:12:14] Bundle org.eclipse.oomph.setup.core 1.26.0.v20221125-1553, build=5729, branch=e3a48095495b13551e05eca4aaee5945806274ab [2022-12-20 20:12:14] Bundle org.eclipse.oomph.setup.p2 1.19.0.v20220607-1104, build=5517, branch=ff2ccc003a1d8c4f5c15c95f48c5dbae54970054 [2022-12-20 20:12:14] Performing Preference /instance/org.eclipse.core.resources/encoding

And there was an empty "encoding" key under "User/User Preferences/org.eclipse.core.resources".

Clicking on the "Oomph preference recorder" button after selecting the "Other" value, as suggested, indeed solved the problem: the key now has the selected value and the selected value remains between sessions.

Thank you very much for your help !!!

I however don't find it very intuitive that one has to click on a button for the preferences of a program to be saved between sessions. Moreover, this button doesn't show up when opening the preferences dialog box for the first time in a session. I have to cancel the dialog box and reopen it to see that button.

I have to say that I'm using Eclipse IDE since many years, and progressively upgraded it when new versions came out while keeping the same home folder, even after upgrading the OS. So maybe this explains my issue.

Best regards and thank you again !

merks commented 1 year ago

In the past, the record button was enabled by default, now it isn't. The first time something was recorded, a detailed help page was displayed. But no one reads it and most people just hit okay/enter/go-away as quick as possible, and then get confused why their recorded preferences are getting applied. Now it's not enabled by default, which wasn't my choice.

So generally you don't need to record this a preference or any other preference and generally the preference will of course be preserved between sessions. But, if you record a preference to a certain setting (as you did at some point in the past), every time you start any IDE on any workspace, that recorded value will be set.