-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Automatically expand full docstring when autocompleting #18582
Comments
Tried my hand at this and below are a few options. Docs shown below the suggestion list Docs shown below the suggestion list + reduced suggestion count so that the item in focus is nearer to the docs. Less jumping of user's focus between item in focus and the docs? Docs shown side to side In all cases the height of the docs section is fixed and the docs is scrollable. I propose to add a setting Thoughts anyone? cc @Microsoft/vscode |
@ramya-rao-a, I'm outside @VScode scope, but I'm in. I think this is a very useful feature. |
@ramya-rao-a the ones on the bottom need either a top border or a different background color imo. |
@mrmlnc So sorry, didn't mean to exclude anybody, updated my text :) |
I really like the last option, showing them to the right (but I agree that it should be configurable) |
I'm not sure making this configurable and supporting multiple configs would be worth it. I certainly wouldn't assume that it would be configurable and seek out a setting to change it. |
VS has been finely tuned for a number of years and pops a window to the right, so #3 is consistent with this behavior. VS pops the flyout after a slight delay it appears, presumably to let you quickly scroll through the IntelliSense list and not be distracted by the flyouts. The flyout window is sized for the content, it does not take up the full height of the IntelliSense list. This is goodness because it obscures less of the screen/underlying code, so I'm in favor of dynamically sizing the doc area. What happens when the editor is too narrow or if the completion is near the end of a long line? |
@chrisdias With narrower editors, the whole section resizes to fit itself. |
I would stay away from any configuration and just provide a single good solution. Overall I really like option 2, if we further decrease the number of options (3-5) and make the height of the documentation variable, taking up as much space as it needs up to a certain point, when it becomes scrollable. |
@ramya-rao-a it would be good to trim any new lines/whitespace at the bottom of the detail message |
Those are not newlines/whitespaces. That is just me trying to guess how may lines the docs may need. Right now I have an approximation logic that works for most cases, and for a few you see a max 2 empty lines in the end. Logic I am using (pretty hacky) is number of chars that fit in a line = 720/fontsize Anybody has any other ideas here, please do share. Now in certain languages (example chinese), chars are wider. So this will not be accurate. Still working on that part |
Wow, this looks fantastic @ramya-rao-a ! |
Don't know if this belongs to here, but hope the suggest item's
|
@octref can you log a separate issue for that? |
Update: The Insiders Build of 5/9 will have the below features.
|
@ramya-rao-a Very good job. Thank you a lot. This feature is AMAZING! |
Update: In addition to #18582 (comment), the Insiders Build of 5/18 will have the below features
|
@ramya-rao-a Very good, but I think the setting will be good or make it by default to expanded/collapsed, because it's way better than before. I think if people forgot to use Ctrl+Space on new VS Code installation or if they want to send same settings to friend/college they need to use Ctrl+Space to expand/collapse the docs. With setting or making it by default it will be way easier to send settings to have the same configuration on VS Code or to use it every time even if you forgot to press Ctrl+Space. This feature must to be turned on by default or have setting instead of Ctrl+Space configuration. A lot of people who want this feature and don't manually read new VS Code release note can't find it in settings and maybe they will create issues or just don't use it, because they think this don't exists. I know it's more job to make settings and so on, but believe me this feature change the VS Code to the next level. My main criterion why I chose VS Code is the best autocomplete ever, but the problem was with the docs. |
Thanks for the feedback @svipben cc @seanmcbreen who is currently looking at default behavior/default settings of the product etc. cc @Microsoft/vscode and everyone else on this thread for thoughts on what the default should be. Ctrl+Space can always be used toggle between expand/collapse. |
For discoverability I would show it expanded by default. It is much easier to imagine what the close button does than what the info button might do. This is especially true for new users. Also: I guess many users will keep the default and not showing the doc would just keep that feature from them. |
@chrmarti @fredrikaverpil I love you guys! 😄 |
Can you elaborate on which section jumps around and when in the latest insiders? |
Perhaps "jumping around" was not the best way to describe what I meant. :) What I meant was that when you hit ctrl + space, the list of available objects varies and so does the height of this list. If you opt to have the docs at the bottom, your eyes won't immediately know exactly where the docs will show up; thus the docs text "jumps around"... Instead, if the docs appear on the side, your eyes will know exactly where to look for it, as it always appears just below the line where you are typing. I merely wanted to point out why I preferred the docs text on the side, and this was why. |
@ramya-rao-a perhaps I found a bug... Please see here (Quicktime): https://drive.google.com/open?id=0B0b1IUnYqENgdk9nU0R1UjlmZ0U I noticed this when I was going to answer your previous question. This is on macOS. EDIT: Added a Quicktime showing it works great with the docs expanding to the side: https://drive.google.com/open?id=0B0b1IUnYqENgbW1tVy1PRV8zeFk ❤️ |
Good catch @fredrikaverpil Fixed with c671df0 The fix will be out in Monday's insiders |
@AndyBay No thats not suppose to happen. The docs are suppose to expand below only if VS Code window is too small to accommodate the side by side view. The list section shrinks only when docs are to expand on the side. When docs end up below, they shouldn't shrink. Are you on the latest insiders? |
@ramya-rao-a I currently use I currently work on a laptop with low resolution so I need to zoom out a bit. I am on the latest insiders yes. |
-- Sorry for the English, I used Google Translator -- @ramya-rao-a Some things I do not understand. So sorry for my silly question, but how do you make the suggestions look like this? or |
@Tekbr that happens only when the VS Code window is too small to hold the docs on the side of the list. |
-- Sorry for the English, I used Google Translator -- |
@Tekbr no, but you can open a new issue for that. If it gets considerable up votes, we will consider adding a setting |
As originally posted as a feature request in the pythonVSCode project:
Would it be possible to automatically expand the docstring without requiring clicking the "info" symbol button?
Current behavior requires you to click the "info" symbol button to view the full docstring:
For comparison, here's how Atom deals with this (always expands the full docstring):
Also, it would be useful to be able to copy paste e.g. a function's arguments from the documentation shown.
The text was updated successfully, but these errors were encountered: