Python, docstring and folding
Hello.
The following docstring is not managed because its content is not indented (this is a legal use of triple quotes).
class MyClass:
"""
Here is a docstring : bla,
bla,
bla...
"""
def __init__(self):
...
Here is another example showing a problem with indentation. Just try this to see that example can be folded.
"""
example
bla, bla, bla....
bla, bla, bla....
"""
Furthermore, since folding is indent-based without regards to the code flow, some methods are simply not foldable. A codebase I work on (external framework, so we're not at liberty to fix up coding style as it would make future merges difficult) is full of examples where the authors comment out lines of code in the middle of methods by putting the '#' on the first column. See attached screenshot for one such example.

I'm unfamiliar with the way Atom handles folding. Is it possible even to ignore unindents if they're part of a docstring or comment?
Atom folds purely based on indentation right now unfortunately. Sorry about that.
Ah, I see, it's an issue in Atom itself, and there already exists an issue for that: atom/atom#3442 so essentially this is blocked until that one's resolved.
Still worth keeping this one open, as the case with Python is a bit more difficult given that the language is indent-based, as opposed to say C++ or PHP.
Works fine for me now, using the new tree-sitter parser. Wouldn't close this issue until it becomes enabled by default, but for those visiting this issue in the meantime: in Settings => Core, enable "Use Tree Sitter Parsers".
It doesn't work for me with Use Tree Sitter Parsers. https://github.com/atom/atom/issues/20128
@boogiefromzk I see that issue is about PHP and not Python. And PHP apparently doesn't use the tree-sitter parsers.
@projetmbc Can you please verify that your issue has been resolved, and close this?
Is it normal that the docstrings are not foldable ?
If it is wanted, I can close this issue. If not I will close this issue and open another.