HCL: document and add more file extensions

remove_eq_on_syntax
Wilfred Hughes 2022-04-24 20:21:10 +07:00
parent ee0f1ee7f2
commit f7c09510a1
3 changed files with 9 additions and 8 deletions

@ -2,7 +2,7 @@
### Parsing
Added support for Perl.
Added support for HCL and Perl.
Improved language detection for JSON. More file extensions and file
names are recognised as JSON, e.g. `.jsonl`.

@ -34,10 +34,11 @@ Difftastic supports the following programming languages.
Difftastic also supports the following structured text formats.
| Language | Parser Used |
|----------|---------------------------------------------------------------------------------|
| CSS | [tree-sitter/tree-sitter-css](https://github.com/tree-sitter/tree-sitter-css) |
| JSON | [tree-sitter/tree-sitter-json](https://github.com/tree-sitter/tree-sitter-json) |
| TOML | [ikatyang/tree-sitter-toml](https://github.com/ikatyang/tree-sitter-toml) |
| YAML | [ikatyang/tree-sitter-yaml](https://github.com/ikatyang/tree-sitter-yaml) |
| Language | Parser Used |
|----------|-----------------------------------------------------------------------------------|
| CSS | [tree-sitter/tree-sitter-css](https://github.com/tree-sitter/tree-sitter-css) |
| HCL | [MichaHoffmann/tree-sitter-hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) |
| JSON | [tree-sitter/tree-sitter-json](https://github.com/tree-sitter/tree-sitter-json) |
| TOML | [ikatyang/tree-sitter-toml](https://github.com/ikatyang/tree-sitter-toml) |
| YAML | [ikatyang/tree-sitter-yaml](https://github.com/ikatyang/tree-sitter-yaml) |

@ -214,7 +214,7 @@ pub fn from_extension(extension: &OsStr) -> Option<Language> {
"gleam" => Some(Gleam),
"go" => Some(Go),
"hs" => Some(Haskell),
"hcl" => Some(Hcl),
"hcl" | "nomad" | "tf" | "tfvars" | "worfklow" => Some(Hcl),
"janet" | "jdn" => Some(Janet),
"java" => Some(Java),
"cjs" | "js" | "mjs" => Some(JavaScript),