GNU bug report logs -
#68579
[PATCH] Support a local repo as URL in treesit-language-source-alist
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#68579: [PATCH] Support a local repo as URL in treesit-language-source-alist
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 68579 <at> debbugs.gnu.org.
--
68579: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68579
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Now _really_ closing the bug.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
TL;DR: this just to simplify debugging/rebuilding treesitter grammars,
because they are often broken (both the build system and the infamous
"unversioning" part) and only Emacs knows what to do with them. So
gotta have some way to point Emacs to a local grammar repo.
-----------
Long story:
I've been recently stumbling upon the infamous "Debug the query with
treesit-query-validate" problem, and found that it's not the only
problem in that context. The workaround to this problem currently is
finding the commit in the offending treesitter-grammar that works and
re-building the grammar from it.
Well, that "re-building" part of the advice turns out to be very
convoluted. Let's take for example typescript¹. It has no "building"
docs, but I guess they are not needed because it's obvious by
`Cargo.toml` presence that it's written in Rust, and hence building is
just `cargo bulid --release`, right? Well, no. Doing that does not
produce the shared libs Emacs expects. Now a user starts reverse-
engineering, trying to find what's wrong. At some point they realize
that Emacs builds code from the specific directory `tsx/src`, but…
There's no build system! What do you do with these files…? Well, the
answer is that Emacs somehow knows what to do, so now you have to
modify `treesit-language-source-alist` to point at the local repo and
make Emacs do the job of building the grammar.
However, Emacs does not support local paths as part of that grammar.
What it does instead is it clones FROM the local path (which is
confusing on itself, because everything completes successfully, but it
didn't do what you expected it to).
So what this patch does is it adds detection of a full path to the
treesit-language-source-alist processing to make sure we avoid cloning
the repo in that case and just proceed building it.
1: https://github.com/tree-sitter/tree-sitter-typescript
[1.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 163 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.