You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment we use the same classes to handle JSON files for all of our settings sections (settings, tasks, launch), and all of them can be reached using the .set and .get methods of the PreferenceService. As a consequence, we've introduced logic that analysis the preference name string fed to those methods and directs the call to the appropriate file handler. For example:
One consequence of this approach is that we cannot easily handle preferences (that belong in settings.json) with the same prefix as a section. For tasks and launch, that isn't generally a problem because the prefix for settings is different from the file name: task rather than tasks, debug rather than launch. However, VSCode also supports an extensions.json file and several preferences with the prefix extensions, and our system cannot correctly handle those settings. If we support extensions.json, then extensions.ignoreRecommendations will be treated as the ignoreRecommendations field of the object in extensions.json rather than the extensions.ignoreRecommendations key of the object in settings.json.
The cleanest solution would be to modify our .set and .get methods to include the section name as an explicit argument (defaulting to settings) or to introduce alternative .getFromSection and .setInSection methods that would include such an argument. If those were used across the board, we could also dispense with some of the logic (dangerously) extracting the section name from the single preference name argument.
The text was updated successfully, but these errors were encountered:
Feature Description:
At the moment we use the same classes to handle JSON files for all of our settings sections (
settings
,tasks
,launch
), and all of them can be reached using the.set
and.get
methods of thePreferenceService
. As a consequence, we've introduced logic that analysis the preference name string fed to those methods and directs the call to the appropriate file handler. For example:theia/packages/preferences/src/browser/folders-preferences-provider.ts
Lines 135 to 137 in eb83e0e
theia/packages/preferences/src/browser/user-configs-preference-provider.ts
Lines 93 to 95 in eb83e0e
theia/packages/preferences/src/browser/workspace-file-preference-provider.ts
Lines 67 to 69 in eb83e0e
theia/packages/preferences/src/browser/section-preference-provider.ts
Lines 71 to 81 in eb83e0e
One consequence of this approach is that we cannot easily handle preferences (that belong in
settings.json
) with the same prefix as a section. Fortasks
andlaunch
, that isn't generally a problem because the prefix for settings is different from the file name:task
rather thantasks
,debug
rather thanlaunch
. However, VSCode also supports anextensions.json
file and several preferences with the prefixextensions
, and our system cannot correctly handle those settings. If we supportextensions.json
, thenextensions.ignoreRecommendations
will be treated as theignoreRecommendations
field of the object inextensions.json
rather than theextensions.ignoreRecommendations
key of the object insettings.json
.The cleanest solution would be to modify our
.set
and.get
methods to include thesection
name as an explicit argument (defaulting tosettings
) or to introduce alternative.getFromSection
and.setInSection
methods that would include such an argument. If those were used across the board, we could also dispense with some of the logic (dangerously) extracting the section name from the single preference name argument.The text was updated successfully, but these errors were encountered: