diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-23 03:29:31 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-23 03:29:31 +0800 |
| commit | 58dc57c855c6923155c80a0332dd3126f687fa38 (patch) | |
| tree | fcf9a787389e4d88e4cc72202b0c6571f73cb358 /build.rs | |
| parent | e63b6f313d2c8452b55910b606ae0ae97c3c49fc (diff) | |
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`.
Diffstat (limited to 'build.rs')
| -rw-r--r-- | build.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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(); + } +} |
