[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tree-sitter api
From: |
Tuấn-Anh Nguyễn |
Subject: |
Re: Tree-sitter api |
Date: |
Fri, 17 Sep 2021 19:11:44 +0700 |
> And I want to also point out that as Emacs core developers, we can’t possibly
> provide a good translation from convention language names to their
> tree-sitter name (C# -> c-sharp). Maybe we can do a half-decent job, but 1)
> that won’t cover all available languages, and 2) if there is a new language,
> we need to wait for the next release to update our translation. It is better
> for the major mode writers to provide the information on how to translate
> names. Because, as I said earlier, they already know it.
This makes sense. My suggestion is, in `tree-sitter.el`:
(defvar tree-sitter-major-mode-language-alist
'((c-mode . c)
;; And other major modes that Emacs includes, or are well-known.
(c++-mode . cpp)
(javascript-mode . javascript)
(python-mode . python))
"Alist that maps major modes to tree-sitter language names.")
For other major modes, it's up to the mode writers to add entries to that list,
similar to what they do with `auto-mode-alist`.
--
Tuấn-Anh Nguyễn
Software Engineer
- Re: Tree-sitter api, (continued)
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/20
- Re: Tree-sitter api, John Yates, 2021/09/20
- Re: Tree-sitter api, Yuan Fu, 2021/09/21
- Re: Tree-sitter api, Yuan Fu, 2021/09/27
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/27
- Re: Tree-sitter api, Stefan Monnier, 2021/09/27
- Re: Tree-sitter api, Yuan Fu, 2021/09/28
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/28
- Re: Tree-sitter api, Yuan Fu, 2021/09/28
- Re: Tree-sitter api, Eli Zaretskii, 2021/09/28
- Re: Tree-sitter api,
Tuấn-Anh Nguyễn <=
- Re: Tree-sitter api, Stefan Monnier, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api, Stefan Monnier, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
- Re: Tree-sitter api, Stefan Monnier, 2021/09/17
- Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/17
Re: Tree-sitter api, Tuấn-Anh Nguyễn, 2021/09/04
Re: Tree-sitter api, Yuan Fu, 2021/09/04