emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tree-sitter api


From: Yuan Fu
Subject: Re: Tree-sitter api
Date: Tue, 14 Sep 2021 17:50:48 -0700

>> 
>> I thought you proposed the major mode thing to replace the naming scheme, 
>> because we were talking about naming languages and translating language 
>> names to library names when you proposed it. So you agree to to the initial 
>> plan to translate tree-sitter-<lang> to libtree-sitter-<lang>.so/etc, and to 
>> use an override alist for irregular names?
> 
> Almost: there's the (minor) problem of obtaining the "<lang>" part by
> the major-mode.  I think it would be good to have a utility function
> to do that so that major modes won't need to reinvent the wheel, do
> the research, etc.

That’s where I don’t understand: the major mode is written by major mode 
writers, who certainly know the correct “<lang>” name: they need to read the 
source of the language definition to use language’s tree-sitter features. You 
seem to agree on that because you said that this function can be extended by 
major mode writers.

But if you mean an ordinary end user need to know the correct <lang> name, then 
it makes more sense. In that case, it is not Emacs’ but major mode writers’ 
responsibility to teach that function how to map a major mode to one or many 
tree-sitter langauge names. Is that what you meant?

Yuan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]