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

Method merge

crates/opencode-config/src/schema.rs:1180–1221  ·  view source on GitHub ↗
(&mut self, other: Config)

Source from the content-addressed store, hash-verified

1178
1179impl Config {
1180 pub fn merge(&mut self, other: Config) {
1181 merge_option_replace(&mut self.schema, other.schema);
1182 merge_option_replace(&mut self.theme, other.theme);
1183 merge_option_deep(&mut self.keybinds, other.keybinds);
1184 merge_option_replace(&mut self.log_level, other.log_level);
1185 merge_option_deep(&mut self.tui, other.tui);
1186 merge_option_deep(&mut self.server, other.server);
1187 merge_option_map_deep_values(&mut self.command, other.command);
1188 merge_option_deep(&mut self.skills, other.skills);
1189 merge_option_deep(&mut self.watcher, other.watcher);
1190 merge_option_replace(&mut self.snapshot, other.snapshot);
1191 merge_option_replace(&mut self.share, other.share);
1192 merge_option_replace(&mut self.autoshare, other.autoshare);
1193 merge_option_replace(&mut self.autoupdate, other.autoupdate);
1194 merge_option_replace(&mut self.model, other.model);
1195 merge_option_replace(&mut self.small_model, other.small_model);
1196 merge_option_replace(&mut self.default_agent, other.default_agent);
1197 merge_option_replace(&mut self.username, other.username);
1198 merge_option_deep(&mut self.mode, other.mode);
1199 merge_option_deep(&mut self.agent, other.agent);
1200 merge_option_map_deep_values(&mut self.provider, other.provider);
1201 merge_option_map_deep_values(&mut self.mcp, other.mcp);
1202 merge_option_deep(&mut self.formatter, other.formatter);
1203 merge_option_deep(&mut self.lsp, other.lsp);
1204 merge_option_replace(&mut self.layout, other.layout);
1205 merge_option_deep(&mut self.permission, other.permission);
1206 merge_option_map_overwrite_values(&mut self.tools, other.tools);
1207 merge_option_deep(&mut self.enterprise, other.enterprise);
1208 merge_option_deep(&mut self.compaction, other.compaction);
1209 merge_option_deep(&mut self.experimental, other.experimental);
1210 merge_option_map_overwrite_values(&mut self.env, other.env);
1211
1212 append_unique_keep_order(&mut self.plugin, other.plugin);
1213 append_unique_keep_order(&mut self.instructions, other.instructions);
1214
1215 if !other.disabled_providers.is_empty() {
1216 self.disabled_providers = other.disabled_providers;
1217 }
1218 if !other.enabled_providers.is_empty() {
1219 self.enabled_providers = other.enabled_providers;
1220 }
1221 }
1222}
1223
1224#[cfg(test)]

Calls 6

merge_option_replaceFunction · 0.85
merge_option_deepFunction · 0.85
append_unique_keep_orderFunction · 0.85
is_emptyMethod · 0.80