Common/Configuration/DTO/ConfigurationTarget.rs
1//! # ConfigurationTarget DTO
2//!
3//! Defines the Data Transfer Object enum for specifying the target scope of a
4//! configuration update.
5
6use serde::{Deserialize, Serialize};
7
8/// An enum that defines the target level for a configuration update. This tells
9/// the `ConfigurationProvider` which `settings.json` file or memory layer to
10/// modify when a setting is changed.
11///
12/// The integer values are chosen for direct compatibility with VS Code's
13/// internal API, ensuring seamless interoperability across IPC boundaries.
14#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
15pub enum ConfigurationTarget {
16 /// Target the user settings file for the local machine.
17 UserLocal = 1,
18
19 /// Target the user settings, potentially synced across machines.
20 User = 2,
21
22 /// Target the workspace settings file (e.g., `.vscode/settings.json`).
23 WorkSpace = 3,
24
25 /// Target a specific folder's settings in a multi-root workspace.
26 WorkSpaceFolder = 4,
27
28 /// Target the default values (typically a read-only operation).
29 Default = 5,
30
31 /// Target the in-memory configuration for the current session only.
32 Memory = 6,
33
34 /// Target the policy-enforced configuration (read-only).
35 Policy = 7,
36}