summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinda_pp <rhysd@users.noreply.github.com>2023-10-04 16:34:40 +0900
committerGitHub <noreply@github.com>2023-10-04 09:34:40 +0200
commit9f795dd9472b24848fe1e2c087cf8163be280fa1 (patch)
treeda3b0e393851d7cdc53baae7d044c9f81387ffda
parent721f956c1c9fdc5d4c60d5137302e347fe5dd49c (diff)
Associate `*.sarif` files with `json` syntax (#2695)
* Associate `*.sarif` files with `json` syntax * Update changelog for #2695
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/syntax_mapping.rs6
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd4afeb4..d4485cb4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,7 @@
- Associate `Containerfile` with `Dockerfile` syntax, see #2606 (@einfachIrgendwer0815)
- Replaced quotes with double quotes so fzf integration example script works on windows and linux. see #2095 (@johnmatthiggins)
- Associate `ksh` files with `bash` syntax, see #2633 (@johnmatthiggins)
+- Associate `sarif` files with `JSON` syntax, see #2695 (@rhysd)
- Associate `ron` files with `rust` syntax, see #2427 (@YeungOnion)
- Add support for [WebGPU Shader Language](https://www.w3.org/TR/WGSL/), see #2692 (@rhysd)
diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs
index d4331bb8..c8c361ab 100644
--- a/src/syntax_mapping.rs
+++ b/src/syntax_mapping.rs
@@ -76,9 +76,9 @@ impl<'a> SyntaxMapping<'a> {
.insert("fish_history", MappingTarget::MapTo("YAML"))
.unwrap();
- mapping
- .insert("*.jsonl", MappingTarget::MapTo("JSON"))
- .unwrap();
+ for glob in ["*.jsonl", "*.sarif"] {
+ mapping.insert(glob, MappingTarget::MapTo("JSON")).unwrap();
+ }
// See #2151, https://nmap.org/book/nse-language.html
mapping