diff options
Diffstat (limited to 'lisp/progmodes/json-ts-mode.el')
-rw-r--r-- | lisp/progmodes/json-ts-mode.el | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 492de6a9027..f26ba9e8d63 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -22,6 +22,15 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. +;;; Tree-sitter language versions +;; +;; json-ts-mode is known to work with the following languages and version: +;; - tree-sitter-json: v0.24.8-1-g4d770d3 +;; +;; We try our best to make builtin modes work with latest grammar +;; versions, so a more recent grammar version has a good chance to work. +;; Send us a bug report if it doesn't. + ;;; Commentary: ;; @@ -29,13 +38,7 @@ (require 'treesit) (require 'rx) - -(declare-function treesit-parser-create "treesit.c") -(declare-function treesit-induce-sparse-tree "treesit.c") -(declare-function treesit-node-start "treesit.c") -(declare-function treesit-node-type "treesit.c") -(declare-function treesit-node-child-by-field-name "treesit.c") - +(treesit-declare-unavailable-functions) (defcustom json-ts-mode-indent-offset 2 "Number of spaces for each indentation step in `json-ts-mode'." @@ -128,7 +131,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'json) (error "Tree-sitter for JSON isn't available")) - (treesit-parser-create 'json) + (setq treesit-primary-parser (treesit-parser-create 'json)) ;; Comments. (setq-local comment-start "// ") |