[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60044: 30.0.50; hideshow in python-ts-mode not working
From: |
Yuan Fu |
Subject: |
bug#60044: 30.0.50; hideshow in python-ts-mode not working |
Date: |
Thu, 15 Dec 2022 17:19:49 -0800 |
Daniel Kraus <daniel@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