emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter api


From: João Távora
Subject: Re: Tree-sitter api
Date: Wed, 30 Mar 2022 14:46:21 +0100

On Wed, Mar 30, 2022 at 4:40 AM Po Lu <luangruo@yahoo.com> wrote:
Yuan Fu <casouri@gmail.com> writes:

> I was saying we can’t use ts as a prefix, but I agree with the idea of
> using a shorter prefix.

But you can have the cake and eat it too, by making `ts' (or some other
short prefix) a shorthand for `tree-sitter' in the files where you want
to use it.

Exactly. And just to highlight this fact: shorthands are per-file. In one
file `tree-sitter-foo` can be shothanded to `ts-foo` but not in others.

If the relevant files are in Emacs core and some official policy states that
no shorthands should be used in versioned files there,  then maybe
your typing/reading aches can still be somewhat solved by temporarily
using the shorthand in your file, reading and writing `ts-foo` wherever
you like (knowing it will be interned `tree-sitter-foo`) and then renaming
everything to `tree-sitter-` before committing.  Personally, I think I'd do
this at least in test/scratch files that exercise the API or in non-core
packages.

João



reply via email to

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