FIX THE CODE FOLDING PLEASE IT's OUTRAGEOUS

Hey, thanks for the report. This is a known limitation with Python code folding in Cursor. The issue affects multiline strings, docstrings, and other constructs. Folding currently works only based on indentation, not language semantics.

This is an upstream limitation in basedpyright (which Cursor’s Python extension is based on). The team is aware and will incorporate improvements when they become available upstream.

You can help by upvoting this GitHub issue: support `textDocument/foldingRange` · Issue #308 · DetachHead/basedpyright · GitHub

As a temporary workaround, you can use indentation-based folding or manually add region markers if needed.

1 Like