Skip to content

feat: preserve multi file mutation structure#8

Merged
spinualexandru merged 2 commits into
mainfrom
feat/improve-multi-file-sourced-files
Nov 30, 2025
Merged

feat: preserve multi file mutation structure#8
spinualexandru merged 2 commits into
mainfrom
feat/improve-multi-file-sourced-files

Conversation

@spinualexandru
Copy link
Copy Markdown
Owner

Solves #7

Context

Adds multi-file mutation tracking to hyprlang-rs, enabling configurations that use source = path directives to save mutations back to the correct source file.

Previously, when a config included multiple files via source directives, all mutations would be merged into a single output. Now, the library tracks which values originated from which file and saves changes only to the modified files while preserving the original file structure.

New API

  • save_all() -> ParseResult<Vec> - Save all modified files, returns list of written files
  • serialize_file(&Path) -> ParseResult - Serialize a specific source file
  • get_key_source_file(&str) -> Option<&Path> - Get which file defines a key
  • get_source_files() -> Vec<&Path> - List all parsed source files
  • get_modified_files() -> Vec<&Path> - List files with pending changes

@spinualexandru spinualexandru merged commit 22b8ba9 into main Nov 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant