emacs-devel
[Top][All Lists]
Advanced

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

Re: Improve "version mismatch" error message from `treesit-parser-create


From: Eli Zaretskii
Subject: Re: Improve "version mismatch" error message from `treesit-parser-create`
Date: Sun, 18 May 2025 09:11:48 +0300

> Date: Sat, 17 May 2025 14:51:10 -0500
> From: Soham Gumaste <sohamg2@gmail.com>
> 
> Hello emacs devs,
> 
> I was recently messing around with treesitter and ran into a "version 
> mismatch" error, which was rather confusing. I found a reddit post where 
> Eli had replied to a similar error message which helped me understand 
> and solve the problem (by fetching an older version of the grammar I 
> wanted to load). (Side-note: Many thanks to Eli for the various 
> reddit/etc replies, you have made my emacs experience better by that alone!)
> 
> I wanted to propose the following improvement to the error message:
>   - Current: A stack trace pops up with string "version mismatch 
> <version of langage attemped>
> 
>   - Proposed: A message/warning/error log with message similar to:
>      "Failed to load <libtree-sitter-NAME.so>: Language version is
>      (attempted version) but only (treesit-library-abi-version) is
>      supported"
> 
> I realize this is a rather small "Developer Experience" (DX) type 
> request. I am looking into the source code to hopefully formulate a 
> patch, but I am unfamiliar with the C side of things.

Your wish has been granted.  In Emacs 31 the message will look like
this:

  Cannot activate tree-sitter, because language grammar for java failed to load 
(language-grammar-version-mismatch): libtree-sitter-java’s ABI version is 15, 
but supported versions are 13-14




reply via email to

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