Update json for emacs29.

This commit is contained in:
Tom Alexander 2023-05-27 17:11:58 -04:00
parent ac95e4b889
commit 8e76c38f23
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 22 additions and 6 deletions

View File

@ -1,6 +1,28 @@
(require 'common-lsp)
(require 'util-tree-sitter)
(use-package json-ts-mode
:ensure nil
:pin manual
:mode (
("\\.json\\'" . json-ts-mode)
)
:commands (json-ts-mode)
:hook (
(json-ts-mode . (lambda ()
(add-hook 'before-save-hook 'json-fmt-jq nil 'local)
))
)
:init
(add-to-list 'treesit-language-source-alist '(json "https://github.com/tree-sitter/tree-sitter-json"))
(unless (treesit-ready-p 'json) (treesit-install-language-grammar 'json))
)
(defun json-fmt-jq ()
"Run jq."
(run-command-on-buffer "jq" "--monochrome-output" ".")
)
(use-package tsx-ts-mode
:ensure nil
:pin manual
@ -62,12 +84,6 @@
;; ;; (before-save . lsp-format-buffer)
;; )
;; )
;; (defun json-fmt-jq ()
;; "Run jq."
;; (run-command-on-buffer "jq" "--monochrome-output" ".")
;; )
;; (use-package web-mode
;; :mode (("\\.dust\\'" . web-mode)
;; )