GNU bug report logs - #75217
31.0.50; tsx-ts-mode has wonky text motions and indentation

Previous Next

Package: emacs;

Reported by: Arsen Arsenović <arsen <at> aarsen.me>

Date: Tue, 31 Dec 2024 01:39:01 UTC

Severity: minor

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Arsen Arsenović <arsen <at> aarsen.me>
Cc: 75217 <at> debbugs.gnu.org
Subject: bug#75217: 31.0.50; tsx-ts-mode has wonky text motions and indentation
Date: Sat, 11 Jan 2025 20:04:01 +0200
> 1. Insert the following into a tsx-ts-mode buffer:
>
> function F() {
>   return (
>     <H>Delete</H>
>   );
> }
>
> 2. Install tree-sitter-tsx v0.23.2
> 3. M-x tsx-ts-mode RET
> 3. M-: (goto-char 39) RET  (somewhere in the middle of "Delete")
> 4. M-b
> 5. Observe that point is not at the start of "Delete"

This is fixed in bug#73978.

> Following that, alter <H> to be <H foo="bar"> and hit RET at the start
> of "Delete", at this point you should see:
>
> function F() {
>   return (
>     <H foo="bar">
> 		   Delete</H>
>   );
> }
>
>
> This is unusual.

What indentation in your opinion would be correct?

> In addition, I just noticed one more thing; make a new file containing:
>
> function F() {
>   return (
>     <H>Delete</H>
>   );
> }
>
> Navigate to the start of "Delete", run M-x treesit-explore RET, hit RET
> and tell the explorer to highlight the jsx_text corresponding to
> "Delete", you should see that the region highlighted is not aligned with
> the end of the word "Delete", and, in turn, all subsequent AST nodes are
> mispositioned too.  Typing again fixes this issue.  It seems that the
> buffer needs to be freshly-started for this to happen for some reason.
>
> I do not have any idea why this might be happening.

I tried, but can't reproduce this treesit-explore issue.




This bug report was last modified 106 days ago.

Previous Next


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