aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/treesit-admin.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/admin/treesit-admin.el b/admin/treesit-admin.el
index 440056aff21..36b8cb620b5 100644
--- a/admin/treesit-admin.el
+++ b/admin/treesit-admin.el
@@ -82,19 +82,19 @@
82The source information are in the format of 82The source information are in the format of
83`treesit-language-source-alist'. This is for development only.") 83`treesit-language-source-alist'. This is for development only.")
84 84
85(defun treesit-admin--verify-major-mode-queries (modes langs grammar-dir) 85(defun treesit-admin--verify-major-mode-queries (modes langs source-alist grammar-dir)
86 "Verify font-lock queries in MODES. 86 "Verify font-lock queries in MODES.
87 87
88LANGS is a list of languages, it should cover all the languages used by 88LANGS is a list of languages, it should cover all the languages used by
89MODES. GRAMMAR-DIR is a temporary direction in which grammars are 89major modes in MODES. SOURCE-ALIST should have the same shape as
90installed. 90`treesit-language-source-alist'. GRAMMAR-DIR is a temporary direction
91in which grammars are installed.
91 92
92If the font-lock queries work fine with the latest grammar, insert some 93If the font-lock queries work fine with the latest grammar, insert some
93comments in the source file saying that the modes are known to work with 94comments in the source file saying that the modes are known to work with
94that version of grammar. At the end of the process, show a list of 95that version of grammar. At the end of the process, show a list of
95queries that has problems with latest grammar." 96queries that has problems with latest grammar."
96 (let ((treesit-extra-load-path (list grammar-dir)) 97 (let ((treesit-extra-load-path (list grammar-dir))
97 (treesit-language-source-alist treesit-admin--builtin-language-sources)
98 (treesit--install-language-grammar-full-clone t) 98 (treesit--install-language-grammar-full-clone t)
99 (treesit--install-language-grammar-blobless t) 99 (treesit--install-language-grammar-blobless t)
100 (version-alist nil) 100 (version-alist nil)
@@ -103,7 +103,9 @@ queries that has problems with latest grammar."
103 (mode-language-alist nil) 103 (mode-language-alist nil)
104 (file-modes-alist nil)) 104 (file-modes-alist nil))
105 (dolist (lang langs) 105 (dolist (lang langs)
106 (let ((ver (treesit-install-language-grammar lang grammar-dir))) 106 (let* ((recipe (assoc lang source-alist))
107 (ver (apply #'treesit--install-language-grammar-1
108 (cons grammar-dir recipe))))
107 (if ver 109 (if ver
108 (push (cons lang ver) version-alist) 110 (push (cons lang ver) version-alist)
109 (error "Cannot get version for %s" lang)))) 111 (error "Cannot get version for %s" lang))))
@@ -200,6 +202,7 @@ queries that has problems with latest grammar."
200 (treesit-admin--verify-major-mode-queries 202 (treesit-admin--verify-major-mode-queries
201 '(cmake-ts-mode dockerfile-ts-mode go-ts-mode ruby-ts-mode) 203 '(cmake-ts-mode dockerfile-ts-mode go-ts-mode ruby-ts-mode)
202 '(cmake dockerfile go ruby) 204 '(cmake dockerfile go ruby)
205 treesit-admin--builtin-language-sources
203 "/tmp/tree-sitter-grammars")) 206 "/tmp/tree-sitter-grammars"))
204 207
205 208