Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-config/src/definition/language.rs')
| -rw-r--r-- | helix-config/src/definition/language.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/helix-config/src/definition/language.rs b/helix-config/src/definition/language.rs new file mode 100644 index 00000000..5042823a --- /dev/null +++ b/helix-config/src/definition/language.rs @@ -0,0 +1,27 @@ +use crate::*; + +options! { + struct LanguageConfig { + /// regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential [language injection][treesitter-language-injection] site. + #[validator = regex_str_validator()] + injection_regex: Option<String> = None, + /// The interpreters from the shebang line, for example `["sh", "bash"]` + #[read = deref] + shebangs: List<String> = List::default(), + /// The token to use as a comment-token + #[read = deref] + comment_token: String = "//", + /// The tree-sitter grammar to use (defaults to the language name) + grammar: Option<String> = None, + } + + struct FormatterConfiguration { + #[read = copy] + auto_format: bool = true, + #[name = "formatter.command"] + formatter_command: Option<String> = None, + #[name = "formatter.args"] + #[read = deref] + formatter_args: List<String> = List::default(), + } +} |