GNU bug report logs -
#60044
30.0.50; hideshow in python-ts-mode not working
Previous Next
Full log
View this message in rfc822 format
Yuan Fu <casouri <at> gmail.com> writes:
> Daniel Kraus <daniel <at> kraus.my> writes:
>
>> Not sure if this is a bug report or feature request
>> but I use hideshow for code folding and I see that
>> `python-base-mode` only adds python-mode to hs-special-modes-alist:
>>
>> (add-to-list
>> 'hs-special-modes-alist
>> `(python-mode
>> ,python-nav-beginning-of-block-regexp
>> ;; Use the empty string as end regexp so it doesn't default to
>> ;; "\\s)". This way parens at end of defun are properly hidden.
>> ""
>> "#"
>> python-hideshow-forward-sexp-function
>> nil
>> python-nav-beginning-of-block
>> python-hideshow-find-next-block
>> python-info-looking-at-beginning-of-block))
>>
>>
>> Simply adding the same with python-ts-mode makes hideshow work
>> but I guess maybe `python-nav-beginning-of-block` etc should
>> be replaced with the equivalent tree-sitter functions?!
>> Maybe it's the same with the other treesit modes, I haven't checked.
>>
>> Thanks,
>> Daniel
>
> Thanks for reporting this! For now I just python-ts-mode to the setup,
> as you suggested. In the future we will switch it to use tree-sitter.
>
> Yuan
Supporting hideshow with tree-sitter is harder that I thought. I didn’t
make it work. So "in the future" is now "in the distant future" :-)
Yuan
This bug report was last modified 2 years and 160 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.