Common/Configuration/DTO/ConfigurationScope.rs
1//! # ConfigurationScope DTO
2//!
3//! Defines the Data Transfer Object enum for representing the scope at which a
4//! configuration setting can be applied.
5
6use serde::{Deserialize, Serialize};
7
8/// An enum that describes the scope of a configuration value, as typically
9/// defined in an extension's `package.json` manifest.
10///
11/// This determines where the setting can be configured by a user (e.g., in
12/// User settings, WorkSpace settings, or both). The integer values are chosen
13/// for direct compatibility with VS Code's internal API.
14#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
15pub enum ConfigurationScope {
16 /// Application-specific configuration, which can only be configured in user
17 /// settings.
18 Application = 1,
19
20 /// Machine-specific configuration, which can only be configured in user
21 /// settings and is not synced.
22 Machine = 2,
23
24 /// Window-specific configuration, which can be configured in user or
25 /// workspace settings.
26 Window = 3,
27
28 /// Resource-specific configuration, which can be configured in all settings
29 /// levels (user, workspace, folder).
30 Resource = 4,
31
32 /// Language-specific configuration, which can be configured in all settings
33 /// levels and can be overridden on a per-language basis.
34 LanguageDefined = 5,
35
36 /// Machine-specific configuration that can be overridden by workspace
37 /// settings.
38 MachineOverridable = 6,
39}