GNU bug report logs - #55428
[feature/tree-sitter] Simplify the parser creation API

Previous Next

Package: emacs;

Reported by: Daniel Martín <mardani29 <at> yahoo.es>

Date: Sun, 15 May 2022 14:17:01 UTC

Severity: wishlist

Full log


Message #8 received at 55428 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 55428 <at> debbugs.gnu.org
Subject: Re: bug#55428: [feature/tree-sitter] Simplify the parser creation API
Date: Sun, 15 May 2022 17:26:11 +0300
> Date: Sun, 15 May 2022 16:15:57 +0200
> From:  Daniel Martín via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 
> Currently, there are three functions to create a tree-sitter parser:
> 
> - treesit-get-parser-create
> - treesit-get-parser
> - treesit-parser-create
> 
> I think this set of similarly named functions can be reduced, so that
> developers don't need to remember a lot of APIs.  How I understand the
> problem of creating a tree-sitter parser is that we need three things
> from the developer:
> 
> - A programming language (a symbol).
> - A buffer (optional, default to the current buffer).
> - Whether to create or reuse an existing parser for that language.
> 
> I think it would be simpler to have just one parser creation API like
> 
> (treesit-make-parser LANGUAGE &optional BUFFER ALWAYS-NEW)

I suggest that discussions about the API be held on emacs-devel, not
hear.  That way, more people will see them and could decide whether to
participate.

Thanks.




This bug report was last modified 3 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.