Cursor position after auto created docstring 关注
When I (auto) create a docstring for a field/property of a class by typing the first three quotation marks and then hitting enter the cursor jumps below the closing quotes, outside of the docstring. I do this quite frequently (for dataclasses) and it is frustrating to have to move the cursor back into the docstring before typing every time.
This does not happen when creating docstrings for classes and methods. Is this expected behavior or a known issue?
请先登录再写评论。
Hello,
there is an existing report which may relate https://youtrack.jetbrains.com/issue/PY-33593/Typing-a-Google-style-docstring-leads-to-the-cursor-being-placed-inside-triple-quotes
Do you use Google style docstring? I have checked with all available styles and could not reproduce the same.
Please upload logs folder zipped from ***Help | Collect logs and Diagnostic Data*** and a screencast is possible, to the FTP
https://uploads.jetbrains.com/ and please let me know the filename.
Hi,
Thanks for the quick response. I looked again more closely and the cursor doesn't actually jump outside the docstring quotes, but still moves to an inconvenient location for fields and other variables. It is just in front of the closing triple quotes, but you must still move the cursor before typing. The issue doesn't seem exactly the same as the one you've referenced. I've uploaded my logs and a screen cast with the id: 2023_03_10_bgJy5fgi8YrYWHrmVs54Ny
Files:
pycharm-docstring-cursor-issue.mp4
pycharm-logs-20230310-0745416502848303728141007.zip
Thank you for the example.
I have submitted the usability issue https://youtrack.jetbrains.com/issue/PY-59499/Cursor-position-in-autodocstring-creation please feel free to vote.