GNU bug report logs -
#77848
31.0.50; treesit-update-ranges: offset setting is ignored for local parsers
Previous Next
Reported by: Roman Rudakov <rrudakov <at> fastmail.com>
Date: Wed, 16 Apr 2025 19:06:03 UTC
Severity: normal
Found in version 31.0.50
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Cc-ing Yuan for the help.
> Hello, I've noticed that when defining 'treesit-range-settings' using the
> 'treesit-range-rules helper function, such as:
>
> (treesit-range-rules
> :embed 'markdown-inline
> :host 'clojure
> :offset '(1 . -1)
> :local t
> (clojure-ts--docstring-query '@capture))
>
> The ':offset' setting doesn't have any effect.
>
> After debugging the 'treesit-update-ranges' function, I noticed that it
> calls 'treesit--update-range-1', which in turn calls
> 'treesit--update-ranges-local' if ':local t' is
> specified. 'treesit--update-ranges-local' does not accept offset as an
> argument, although it is mentioned in its documentation string:
>
>> OFFSET is a cons of start and end offsets that are applied to the range
>> for the local parser.
>
> This discrepancy between the documented behavior and the actual
> implementation of 'treesit--update-ranges-local' regarding the offset
> argument might be a bug.
This bug report was last modified 27 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.