Python Folding (again)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

My python folding is broken, and I don’t know how to fix it. In fact it’s driving me crazy!

I reported it here: Jedi Python Folding - #7 but the issue was closed for no apparent reason.

Steps to Reproduce

IDK bro, it’s just broken in my instance.

If you look at the attached image, clicking the top most ‘collapse’ button colapses the whole function in vscode (light mode) but only collapses the header in cursor (dark mode). look at the extra ‘collapsy’ buttons in the documentation string… why?

Expected Behavior

I just want it to work like vscode does. e.g. proper python folding

Screenshots / Screen Recordings

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.43
VSCode Version: 1.99.3
Commit: 8e4da76ad196925accaa169efcae28c45454cce0
Date: 2025-10-30T18:49:27.589Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.8.0-86-generic

Additional Information

It’s been ages, and it’s driving me crazy.

Does this stop you from using Cursor

No - Cursor works, but with this issue

I just deleted everything under ~/.config/Cursor/User/settings.json and .vscode/settings.json literally just contains `{“editor.showFoldingControls”: “always”}.

You can see the extensions I have, and this is a local file. Yet, see the attached image in comparison to vscode:

Note that clicking the ‘fold’ button on the def line in vscode folds the whole function (line 98 to 148). The same button in cursor folds 98 to 118.

This is driving me crazy!

Note the other errors folding the dockstring.

This is clearly an issue with cursor pyright vs. ms pyright (at least on my OS).

Please don’t close without a solution, even if the solution is wont fix. At least then I’ll know not to use cursor.

Please let me know what other debugging info I can provide.

Thanks

1 Like

Thanks for this. Makes me feel better to know that I’m not suffering alone! (Sorry everyone!)

Surely we can disable the Cursor Python Plugin thingy and add back the Microsoft pyright?

I see from a business perspective why they want to clone the open source python extensions and flavour them cursor, but when that comes at the cost of functionality, it’s not good business.

Thanks again,

1 Like