From 6280706ecd17e889e0dd42ac3845864ed7e2e49e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 10 Mar 2024 20:02:46 +0300 Subject: [PATCH] feat(treecrumbs): support for JSON Fairly similar to YAML, except with only one way of naming keys and arrays. Change-Id: Ic2fa539466d69af55b36401bb8c03f2c7edcd91d Reviewed-on: https://cl.tvl.fyi/c/depot/+/11112 Reviewed-by: tazjin Autosubmit: tazjin Tested-by: BuildkiteCI --- tools/emacs-pkgs/treecrumbs/treecrumbs.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/emacs-pkgs/treecrumbs/treecrumbs.el b/tools/emacs-pkgs/treecrumbs/treecrumbs.el index a01e5490f..54e216038 100644 --- a/tools/emacs-pkgs/treecrumbs/treecrumbs.el +++ b/tools/emacs-pkgs/treecrumbs/treecrumbs.el @@ -90,6 +90,11 @@ The defined languages are stored in `treecrumbs-languages'." ("flow_pair" . ((_) key: (_) @key)) ("flow_sequence" . "[]")) +(define-treecrumbs-language json + ;; In JSON documents, crumbs are generated from key names and array fields. + ("pair" . ((pair key: (string (string_content) @key)))) + ("array" . "[]")) + (define-treecrumbs-language cpp ;; In C++ files, crumbs are generated from namespaces and ;; identifier declarations.