dprint_plugin_jupyter/configuration/resolve_config.rs
1use super::Configuration;
2use dprint_core::configuration::*;
3
4/// Resolves configuration from a collection of key value strings.
5///
6/// # Example
7///
8/// ```
9/// use dprint_core::configuration::ConfigKeyMap;
10/// use dprint_core::configuration::resolve_global_config;
11/// use dprint_plugin_jupyter::configuration::resolve_config;
12///
13/// let mut config_map = ConfigKeyMap::new(); // get a collection of key value pairs from somewhere
14/// let global_config_result = resolve_global_config(&mut config_map);
15///
16/// // check global_config_result.diagnostics here...
17///
18/// let config_result = resolve_config(
19/// config_map,
20/// &global_config_result.config
21/// );
22///
23/// // check config_result.diagnostics here and use config_result.config
24/// ```
25pub fn resolve_config(
26 config: ConfigKeyMap,
27 _global_config: &GlobalConfiguration,
28) -> ResolveConfigurationResult<Configuration> {
29 let mut diagnostics = Vec::new();
30
31 let resolved_config = Configuration {
32 // todo...
33 };
34
35 diagnostics.extend(get_unknown_property_diagnostics(config));
36
37 ResolveConfigurationResult {
38 config: resolved_config,
39 diagnostics,
40 }
41}