MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / load_global

Method load_global

crates/opencode-config/src/loader.rs:63–85  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

61 }
62
63 pub fn load_global(&mut self) -> Result<()> {
64 let global_config_path = get_global_config_path();
65
66 for ext in &["jsonc", "json"] {
67 let path = global_config_path.with_extension(ext);
68 if path.exists() {
69 self.load_from_file(&path)?;
70 break;
71 }
72 }
73
74 if let Some(global_config_dir) = global_config_path.parent() {
75 if let Some(migrated_path) =
76 migrate_legacy_toml_config(global_config_dir, &mut self.config)
77 {
78 if !self.config_paths.contains(&migrated_path) {
79 self.config_paths.push(migrated_path);
80 }
81 }
82 }
83
84 Ok(())
85 }
86
87 pub fn load_project<P: AsRef<Path>>(&mut self, project_dir: P) -> Result<()> {
88 let input = project_dir.as_ref();

Callers 1

load_allMethod · 0.80

Calls 5

get_global_config_pathFunction · 0.85
existsMethod · 0.80
containsMethod · 0.80
load_from_fileMethod · 0.45

Tested by

no test coverage detected