From 58dc57c855c6923155c80a0332dd3126f687fa38 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 23 Jul 2026 03:29:31 +0800 Subject: feat: add section-aware TOML key lookup for rust-analyzer config Make TOML key lookups in `mlint install` commands aware of the `[rust-analyzer]` section boundaries. Introduce a shared TOML section parsing utility and refactor `find_key_value` and `find_table_header` into section-scoped equivalents (`find_key_in_section`, `build_override_insert`). Also add a build script to copy `.run/rust-analyzer.toml` to the workspace root if absent, and add the generated copy to `.gitignore`. --- build.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 build.rs (limited to 'build.rs') diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..94e3e0d --- /dev/null +++ b/build.rs @@ -0,0 +1,9 @@ +use std::{env::current_dir, fs}; + +fn main() { + let path = current_dir().unwrap().join("rust-analyzer.toml"); + let template_content = include_str!("./.run/rust-analyzer.toml"); + if !path.exists() { + fs::write(path, template_content).unwrap(); + } +} -- cgit