GNU bug report logs -
#77746
[PATCH] sh-mode: Fix incorrect word syntax for punctuation in sh-mode
Previous Next
Reported by: James Cherti <contact <at> jamescherti.com>
Date: Fri, 11 Apr 2025 14:56:02 UTC
Severity: normal
Tags: patch
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #98 received at 77746 <at> debbugs.gnu.org (full text, mbox):
On 2025-04-15 14:25, Eli Zaretskii wrote:
>> Date: Tue, 15 Apr 2025 12:22:08 -0400
>> Cc: juri <at> linkov.net, 77746 <at> debbugs.gnu.org
>> From: James Cherti <contact <at> jamescherti.com>
>>
>> On 2025-04-15 11:24, Eli Zaretskii wrote:
>> >> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
>> >> Cc: James Cherti <contact <at> jamescherti.com>, 77746 <at> debbugs.gnu.org,
>> >> juri <at> linkov.net
>> >> Date: Tue, 15 Apr 2025 11:17:02 -0400
>> >>
>> >>>> The issue occurs in both sh-mode and bash-ts-mode.
>> >>> I'm surprised that bash-ts-mode should use syntax tables, instead of
>> >>> relying on the results of parsing by tree-sitter.
>> >>
>> >> It's not front-and-center in his bug report, but what he means by
>> >> "completion" seems to be mostly dabbrev completion, which doesn't make
>> >> use of tree-sitter.
>> >
>> > He also mentioned font-lock.
>>
>> Yes, this patch fixes dabbrev, functions such as
>> (highlight-symbol-at-point), and any other function that
>> relies on thing-at-point for symbol detection.
>>
>> (The core issue is inaccurate symbol detection. This patch
>> improves it by excluding characters that should not be
>> considered part of a valid variable name.)
>
> I'd expect a parser to detect variable names correctly, and without
> the help of our syntax tables and related code.
Hello Eli,
It would be highly convenient if the Tree-sitter parser
could accurately detect variable names (e.g., the symbol at point).
While this would not fix sh-mode, it would at least enable an
improved editing experience when using bash-ts-mode.
--
James Cherti
GitHub: https://github.com/jamescherti
Website: https://www.jamescherti.com/
This bug report was last modified 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.