Overview
A Settings Controller is a service that encapsulates both the persistence and calculation of individual values. Each setting is represented by a distinct key.
The Settings Controller returns a calculated value corresponding to a given key. A "calculated" value means that the actual value is computed based on the setting value derived from all participating sources.
The order of the extensions defines the sequence in which the controllers are processed. The mediator continues to process these controllers until a result is resolved.
Use Cases
Remote Dev
To ensure that a network request isn't performed for each setting, a setting storage blob may initially be prepared and sent to the remote setting controller. The default IJ Platform local setting controller is designed with that in mind.
Process per Connection
Local Only. We do not want to clone the configuration directory for each connection. The same configuration directory is reused for all clients.
TBE
Set or get a specific setting (instead of only operating at the container level).
Access settings without needing to know the implementation details of a container through a key-value API (see
RawSettingSerializerDescriptor
).Prevent certain keys from being set by the user (making them read-only settings). See Mutability.
Intercept the events that signal a setting has been modified.
Instruct to use the "default" value for a certain key.
Service
A service is an entity that implements specific IDE functionality. The Settings API, replacing the previous PropertiesComponent
, can be used anywhere a suspend context is available.
Still, the term Service
is chosen specifically, advocating that ideally, all code should be implemented as a service.