Skip to content

Automatically expand full docstring when autocompleting #18582

Closed

Description

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:

01

02

For comparison, here's how Atom deals with this (always expands the full docstring):

atom

Also, it would be useful to be able to copy paste e.g. a function's arguments from the documentation shown.

Activity

  1. added
    feature-request
    suggest
    on Jan 16, 2017
  2. ramya-rao-a commented on Apr 23, 2017

    @ramya-rao-a
    Contributor

    Tried my hand at this and below are a few options.

    Docs shown below the suggestion list

    ezgif com-video-to-gif-2

    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?

    ezgif com-video-to-gif-3

    Docs shown side to side

    ezgif com-video-to-gif-4

    In all cases the height of the docs section is fixed and the docs is scrollable.
    Some smart logic can be added to make the height of the docs dynamic.
    But different font-sizes and fonts would render text with different width. So that can get tricky.

    I propose to add a setting editor.suggestAutoExpand with true/false: false by default
    Or with off, below, side. off by default
    Get user feedback and then take it from there.

    Thoughts anyone?

    cc @Microsoft/vscode

  3. mrmlnc commented on Apr 23, 2017

    @mrmlnc
    Contributor

    Ramya Rao (@ramya-rao-a), I'm outside Victor Salazar (@VScode) scope, but I'm in. I think this is a very useful feature.

  4. Tyriar commented on Apr 23, 2017

    @Tyriar
    Contributor

    Ramya Rao (@ramya-rao-a) the ones on the bottom need either a top border or a different background color imo.

  5. ramya-rao-a commented on Apr 23, 2017

    @ramya-rao-a
    Contributor

    Denis Malinochkin (@mrmlnc) So sorry, didn't mean to exclude anybody, updated my text :)

  6. roblourens commented on Apr 23, 2017

    @roblourens
    Member

    I really like the last option, showing them to the right (but I agree that it should be configurable)

  7. Tyriar commented on Apr 23, 2017

    @Tyriar
    Contributor

    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.

  8. chrisdias commented on Apr 24, 2017

    @chrisdias
    Contributor

    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?

  9. ramya-rao-a commented on Apr 24, 2017

    @ramya-rao-a
    Contributor

    Chris Dias (@chrisdias)
    When completion is near the end of a long line, the suggestion list as well as the docs show up on the left side of the cursor just like it does today.

    screen shot 2017-04-23 at 10 26 10 pm

    With narrower editors, the whole section resizes to fit itself.

    screen shot 2017-04-23 at 10 25 13 pm

  10. joaomoreno commented on Apr 24, 2017

    @joaomoreno
    Contributor

    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.

  11. ramya-rao-a commented on Apr 24, 2017

    @ramya-rao-a
    Contributor

    Here are some updates:

    The side by side option with the docs now having dynamic height instead of fixed height

    ezgif com-video-to-gif-5

    The below option with lesser items, border between items and docs and dynamic height instead of fixed height
    ezgif com-video-to-gif-6

  12. 17 remaining items

  13. fredrikaverpil commented on May 19, 2017

    @fredrikaverpil
    Author

    I also wish to somehow make it expanded by default. A setting in settings.json is fine with me.
    I personally prefer the settings appearing on the side. ❤️

    screen shot 2017-05-19 at 08 02 58

    I like the docs on the side as then this section won't jump around and will always start just under the line where I'm typing.

  14. svipas commented on May 19, 2017

    @svipas
    Contributor
  15. ramya-rao-a commented on May 19, 2017

    @ramya-rao-a
    Contributor

    Fredrik Averpil (@fredrikaverpil)

    I like the docs on the side as then this section won't jump around and will always start just under the line where I'm typing.

    Can you elaborate on which section jumps around and when in the latest insiders?

  16. fredrikaverpil commented on May 20, 2017

    @fredrikaverpil
    Author

    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.
    Does this make sense to you and does this answer your question?

  17. fredrikaverpil commented on May 20, 2017

    @fredrikaverpil
    Author

    Ramya Rao (@ramya-rao-a) perhaps I found a bug...

    Please see here (Quicktime): https://drive.google.com/open?id=0B0b1IUnYqENgdk9nU0R1UjlmZ0U
    I first hit ctrl + space to bring up the list of objects. Then I hit ctrl + alt + space to show the docs at the bottom. See how the docs text doesn't update while I move up and down the list of objects?

    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 ❤️

  18. ramya-rao-a commented on May 20, 2017

    @ramya-rao-a
    Contributor

    Good catch Fredrik Averpil (@fredrikaverpil)
    Ctrl+Alt+Space was meant to move focus between list and docs but only if the docs was already expanded.

    Fixed with c671df0

    The fix will be out in Monday's insiders

  19. AndyBay commented on May 22, 2017

    @AndyBay

    Right now when expanding docs for local variables with no documentation, the widget window shrinks when it previously did nothing. Is this supposed to happen?
    intellisense_widget_doc_expand_placement
    I much preferred how it was a couple updates ago with the expanded docs to the side. Will there be an option for the placement or is it now set to be below?

  20. ramya-rao-a commented on May 22, 2017

    @ramya-rao-a
    Contributor

    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?

  21. AndyBay commented on May 22, 2017

    @AndyBay

    Ramya Rao (@ramya-rao-a) I currently use "window.zoomLevel": -1 which seems to force placement below. If I change the setting to 0 I get correct placement to the right side.

    I currently work on a laptop with low resolution so I need to zoom out a bit.

    I am on the latest insiders yes.

  22. Tyriar commented on May 22, 2017

    @Tyriar
    Contributor

    AndyBay that's captured in #26886

  23. Tekbr commented on May 26, 2017

    @Tekbr

    -- Sorry for the English, I used Google Translator --

    Ramya Rao (@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

  24. ramya-rao-a commented on May 27, 2017

    @ramya-rao-a
    Contributor

    Tekbr that happens only when the VS Code window is too small to hold the docs on the side of the list.

  25. Tekbr commented on May 29, 2017

    @Tekbr

    -- Sorry for the English, I used Google Translator --
    Ramya Rao (@ramya-rao-a) Is there an issue with this request to be on the bottom? That is, make it configurable?

  26. ramya-rao-a commented on May 30, 2017

    @ramya-rao-a
    Contributor

    Tekbr no, but you can open a new issue for that. If it gets considerable up votes, we will consider adding a setting

  27. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestsuggest

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions