How migrate extensions for the preferences changes?

Hello. I am going through the breaking changes for Theia 0.7.0 for our extensions and I am a bit confused about the changes for Preferences. What is the best issue to look at for what has changed and how extensions should migrate their preferences? I see the strangest behavior at the moment such as no Workspace tab for new worspaces and for workspaces created in previous version I see that the workspace preferences get automatically updated with some of my user preferences. (I assume this has something to do with new scoping concept, but can this be prevented as some of our custom user preferences include passwords that I do not want to be copied accidentally into workspace settings?)

My console shows warnings such as these:

root WARN Preference application.confirmExit in file:///Users/phaumer/Dev/Wazi/wazi-sample/.theia/settings.json can only be defined in scopes: Default, User, Workspace.

I also see the effect that for existing workspaces all files that I open have a blue change bar from top to bottom. Is that related to some preferences or do we adoption anything related to the SCM changes; I see the extension included automatically in our About window? I deleted the ~/.theia directory and the browser storage, but that did not fix anything.

[original thread by Peter Haumer]

@phaumer from user perspective there was not breaking changes to preferences, only from IDE developers

Can you reproduce an issue with Theia master?

there was a refactoring to align with VS Code preferences behaviour it could cause an issue for you

SCM should be fine.

preference scope defines where a user can declare prefernce values, by default only for worskpace

you can set it to resource for your preferences to allow everywhere

just add ‘scope’: ‘resource’ to your preference schema at the root or for an individual property

at the root like here https://github.com/theia-ide/theia/blob/76a6bc487a5fc20f7ec746acdcb666e44ae966f4/packages/editor/src/browser/editor-preferences.ts#L46

[Peter Haumer]

Thanks for the tips. I made progres now adding the scope property to our own preferences, but the scope seems to be different when using PreferenceServiceImpl.set() as it does not allow resource. I tried to use Folder, but that does not seem to write it back to the same location.

I switched the preference to the User scope for now, but this still allows me to enter these preferences into a workspace settings file without getting errors. It just does not seem to use them, but do you agree that it should actually cause an error?

I also see that the scope property is missing in some of the Theia preferences (e.g. in core/src/browser/core-preferences.ts) and other people must see the same warnings as the one I showed above as well?

cc @elaihau you probably know better about current preference scope handling

We have plans fix it and align with VS Code in next releases: https://github.com/theia-ide/theia/issues/5021