-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "fold all docstrings" command #4677
Comments
Thought this might be a good thing to do in the near future. |
Good to see that this nuisance is getting tackled. Here is a similar request from me in PTVS - it would be good if the solution were applicable in VS, too. |
Unfortunately, I believe PTVS would have to be done separately. The same commands don't apply to Visual Studio. |
Historically related: microsoft/vscode-python#20330 Related on Stack Overflow: The "Fold All Block Comments" command doesn't work on Python docstrings in files with certain arrangements of import, where it was also discovered that interestingly, the |
I made a vscode extension to tackle this exact problem, as it was bugging me so much: |
This issue has been fixed in prerelease version 2024.10.102, which we've just released. You can find the changelog here: CHANGELOG.md |
I found this listed on the release notes but had to came here to find out it is "pre-release" |
@Diogo-Rossi, sorry for the confusion. Our stable release was delayed due to a regression that we found late in the testing process. The stable release will probably ship today. |
This feature is now available in stable release 2024.11.1, which we've just released. |
Discussed in #3933
Originally posted by jonasreiher December 8, 2022
Docstrings covering all input parameters, types and precise function/class descriptions can become quite long and get in the way of the actual code. Usually, you only need to look into them when writing them or when looking up a specific function/class and it would be preferable to have them folded most of the time. You can do this by clicking the arrow next to the line numbers for each of them. This becomes tedious for files with a lot of docstrings, though.
There exists the "fold all block comments" command in VS Code but docstrings are not considered as block comments since they have the same format as multi-line strings and you wouldn't want to fold them away (see microsoft/vscode-python#20330).
Proposal: a "fold all docstrings" command that, well, folds all docstrings, so multi-line strings that are the first item in a function/class definition.
Alternative proposal: classify all multi-line strings as block comments that are are not inside of a function call or variable assignment. This would be consistent with the "toggle block comment" command that wraps the selection in triple quotes. Creating a block comment like this but then not being able to fold it with "fold all block comments" seems contradictory.
The text was updated successfully, but these errors were encountered: