forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(format): current file in formatter args
Add support for a current file placeholder in formatter arguments. This should make it possible to run custom formatters, such as `rome` (Typescript), `rustfmt` (Rust) and more. The changes take inspiration from f7ecf9c and acdce30, but instead of adding a new field to the formatter struct, it works by looking for a predefined placeholder (`{}`), which should be replaced, if found. This should allow for better control over arguments of formatters, allowing both giving it as a standalone arg (`"{}"`) and as part of one (ie `"--src-file={}"`). The placeholder, `{}`, is used since it is common, Rust using it frequently. Closes: helix-editor#3596 Signed-off-by: Filip Dutescu <[email protected]>
- Loading branch information
1 parent
b65f104
commit e90ef73
Showing
3 changed files
with
124 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters