The cursor IDE is not performing the expected behavior when editor.foldingStrategy is set to auto. Folding is only performed based on indentation. This means it is not possible to fold elements such as variables, f-strings, unless they are indented.
In case it helps, below are some additional examples of folding disparities between VSCode and Cursor.
In the examples below, I am explicitly setting "editor.defaultFoldingRangeProvider": "ms-python.vscode-pylance" in VSCode.
Notes:
The folding is correctly applied in VSCode despite indentation for the string and docstring variables, dictionary, and the multiline function. Cursor does not provide folding for the first three, and provides duplicate folding for the function.
This behavior in Cursor occurs despite setting editor.foldingStrategy: "auto" , which should automatically select the default language server to provide the folding strategy.