GNU bug report logs - #59853
30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior

Previous Next

Package: emacs;

Reported by: Brian Leung <leungbk <at> posteo.net>

Date: Tue, 6 Dec 2022 06:22:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 29.1

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Brian Leung <leungbk <at> posteo.net>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: casouri <at> gmail.com, 59853 <at> debbugs.gnu.org
Subject: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior
Date: Wed, 07 Dec 2022 09:51:35 +0000
Theodor Thornhill <theo <at> thornhill.no> writes:

> Not sure I can reproduce this.

Sorry, I made a mistake in my description. I additionally noticed 
additional odd results in java-ts-mode. Let me try again:

> p[u]blic abstract class Class {
>     public static interface Interface {
>         void someMethod();
> [*]
>         void otherMethod();
>     [}]
> }

1. When point is at the "u" in "public", narrow-to-defun cuts off 
"pu" and moves point to "b".
2. When point is anywhere in the first line of the class 
declaration, mark-defun highlights "void otherMethod()", instead 
of the entire class declaration.
3a. When point is at the [*] in between someMethod and 
otherMethod, narrow-to-defun captures "void otherMethod()". I feel 
that since the methods inside the interface declaration have no 
bodies, it makes more sense to capture the entire interface 
definition if point is at [*].
3b. Arguably, even if point were on the method declarations, we 
might still want to (as plain java-mode does) capture the entire 
interface definition, since body-less method declarations don't 
feel especially defun-like.
4. When point is on the closing bracket of the interface 
definition, narrow-to-defun captures

>         void otherMethod();
>     }
> }

which looks quite unusual to me.




This bug report was last modified 2 years and 139 days ago.

Previous Next


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