Open fredericomattos opened 2 years ago
My guess is that when VS code opens, it provides the folding ranges. Then when pylance loads, it updates the allowed folding ranges to include the list.
This seems correct because if you just close and reopen the file, it remembers them.
Yeah, it seems the unfolding happens before the pylance server loads, so VS code is doing the unfolding. When pylance loads again it does provide the folding ranges back, so theoretically VS code should refold the entries:
This seems like a bug in VS code.
The pylance folding provider includes the closing ]
in the folding range. Is that intended?
The pylance folding provider includes the closing
]
in the folding range. Is that intended?
AFAIK, yes. Is that causing the problem?
While the pylance extension is starting, the indent folding provider is used, and it has smaller ranges. Currently we interpret this as a user edit and unfold the ranges.
It's tricky, and ideally we would not unfold in this case.
I see that this bug has been open for > 12 months. Since I am affected by it myself, my question. Do we have a change that this will be fixed soon?
Pylance language server 2022.11.10 (pyright 4e50162d) Python version 3.10 Python platform Windows Pylance v2022.11.10
https://user-images.githubusercontent.com/58320500/199490941-be69bd5e-d3a8-484f-a8c5-315cad713db7.mp4
This is the part of the code that is automatically expanded when I open VSCode without me clicking to expand: