GNU bug report logs -
#62333
30.0.50; Issue with tree-sitter syntax tree during certain changes
Previous Next
Full log
View this message in rfc822 format
>>> User-defined narrowing will never contradict parser restrictions.
>>
>> You mean, they will be independent, right? In other words, if the user
>> sets the narrowing to 1000-1200 in a buffer in which
>> treesit-make-parser has been called, say, once with 'php 400 1100' and
>> once with 'js 1100 1500', the two parsers will continue to have access
>> to these ranges?
>
> The parsers _can_ have access to those ranges, if they need it for some
> reason. In general, everything in Emacs should honor the current
> restriction, unless there's a good reason to ignore it.
>
Okay, so in the above example by default the parsers will only have access
to 1000-1100 for the first one, and 1100-1200 for the second one until the
user removes the restrictions. Unless they need to widen the buffer for
some (good) reason.
If they do widen, will the parsers get access to [400..1100] and
[1100..1500], or to the whole buffer? Or will they have two ways to
widen, one to get access to the whole region on which they have been
defined, and another one to get access to the whole buffer?
>
> The problem with ignoring it is that we can never know which code/user
> defined the restriction and for what purpose. I hope that keeping the
> parser's restrictions as part of the parser itself will allow us to
> break free of that issue when we have to widen.
>
At least it's a possibility that seems worth investigating.
This bug report was last modified 2 years and 77 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.