]> git.eshelyaron.com Git - emacs.git/commit
Simplify error reported by loading tree-sitter language definition
authorYuan Fu <casouri@gmail.com>
Mon, 17 Oct 2022 21:12:24 +0000 (14:12 -0700)
committerYuan Fu <casouri@gmail.com>
Mon, 17 Oct 2022 21:12:24 +0000 (14:12 -0700)
commite8df6c311fcf59bf23d31b9db2bb8fec9d78fbe7
tree3338ca7cfd0957063bca0b26fb2da8c791436566
parent0be9a639fca70c278d1b79fcea5d6beebdf7799c
Simplify error reported by loading tree-sitter language definition

Before:

Error: Cannot load language definition:
"javascript",
("/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript:
cannot open shared object file: No such file or directory"
"/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript.so:
cannot open shared object file: No such file or directory"
"libtree-sitter-javascript: cannot open shared object file: No such
file or directory" "libtree-sitter-javascript.so: cannot open shared
object file: No such file or directory")

After:

(treesit-load-language-error
not-found
("libtree-sitter-z.so" "libtree-sitter-z.dylib")
"No such file or directory")

* src/treesit.c (treesit_load_language): Add base_candidates, remove
error_list, report base_candidates rather than error_list.
src/treesit.c