JamieMason / JamieMason/syncpack
feat(fs): preserve original formatting in Rust implementation
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
From #197
> One thing I'm missing in the Rust implementation is #241 is regressed and I can't find anything in Rust that maintains the original formatting of the parsed in JSON file
>
> @JamieMason
> I'm still curious about the format-preservation regression -- to avoid mixing two discussions in this thread, do you want to make a separate issue to track that one? Or maybe there already is one?
>
> @tylerd-canva
The gist of it is that I can't find a library in Rust which will parse JSON, let you modify that JSON in memory, and then write it back to disk while preserving the original indentation etc of the original file. In TypeScript I used [jsonc-parser](https://www.npmjs.com/package/jsonc-parser) but I've not been able to find an equivalent in Rust.
Contributor guide
Research direction
Start by reviewing the Rust implementation and the context in issues #197 and #241, then investigate Rust libraries that can parse and rewrite JSON while preserving the original formatting. Use TypeScript's jsonc-parser as the stated reference; done means modified JSON can be written back without losing the source indentation and related formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100