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 <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2024-03-10 20:02:46 +03:00 committed by clbot
parent 3b7e546dfc
commit 6280706ecd

View file

@ -90,6 +90,11 @@ The defined languages are stored in `treecrumbs-languages'."
("flow_pair" . ((_) key: (_) @key)) ("flow_pair" . ((_) key: (_) @key))
("flow_sequence" . "[]")) ("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 (define-treecrumbs-language cpp
;; In C++ files, crumbs are generated from namespaces and ;; In C++ files, crumbs are generated from namespaces and
;; identifier declarations. ;; identifier declarations.