Skip to content

Donn't render newline-characters as new lines in suggest details widget #99370

Closed

Description

  • VSCode Version: 1.45.1
  • OS Version: any

Steps to Reproduce:

  1. Create an extension providing a completion item with detail set to
    "void writeln(\n\tT...\n)(\n\tT args\n)"

  2. Observe that VSCode reordered the detail string in the small view:
    (changed to void writeln( ) T...)
    reordered

  3. Observe that the big detail view is missing the indentation: (doesn't work with tabs or with spaces)
    missing indentation

On the API documentation (https://code.visualstudio.com/api/references/vscode-api#CompletionItem) it says detail is just "A human-readable string with additional information about this item", so I wouldn't expect VSCode to split it up into lines, reorder the lines and show that in the short UI.

The missing indentation part is probably a separate issue from this though.

Activity

  1. added
    help wantedIssues identified as good community contribution opportunities
    suggestIntelliSense, Auto Complete
    uxUser experience issues
    feature-requestRequest for new features or functionality
    on Jun 5, 2020
  2. changed the title [-]CompletionItem.detail reordered + formatted / not used as is[/-] [+]Donn't render newline-characters as new lines in suggest details widget[/+] on Jun 5, 2020
  3. jrieken commented on Oct 5, 2020

    @jrieken
    Contributor

    Let's try this for October...

    Screenshot 2020-10-05 at 11 52 05

  4. WebFreak001 commented on Oct 5, 2020

    @WebFreak001
    Author

    I actually quite liked that the suggest details widget showed newlines, instead my issue was that the small preview had mixed up the string somehow and I mentioned in the side that the details widget showed the string correctly, but without indentation.

    For complex strings I think it's actually a good idea to keep the details widget newlines and properly embrace it as a feature.

  5. 8 remaining items

  6. jrieken commented on Oct 26, 2020

    @jrieken
    Contributor

    I pushed a change to render line breaks as they are. No line breaks that are inserted to fit into the rendering box

  7. jrieken commented on Oct 26, 2020

    @jrieken
    Contributor

    to verify:

    • open suggest details for various completions like TS auto imports, TS DOM types like AbortController etc pp
    • make sure the details isn't wrapped artificially but only at lines breaks the extension/provider has defined
  8. jrieken commented on Oct 27, 2020

    @jrieken
    Contributor

    Daniel Imms (@Tyriar) for verification

  9. jrieken commented on Oct 27, 2020

    @jrieken
    Contributor

    Refinement: when details (as provided by the extension) contain line breaks then we'll don't allow render-only breaks but when details are a single line we do wrap for rendering.

  10. JacksonKearl commented on Oct 28, 2020

    @JacksonKearl
    Contributor

    Spot on.
    image

  11. Tyriar commented on Oct 29, 2020

    @Tyriar
    Contributor

    The primary case I had issue with is covered now:

    image

    image

    I found one minor issue when long symbols are used, but you could argue that I just need to resize the detail and I will do that, so I'm fine with this:

    image

    Thanks for following this up 👍

  12. locked and limited conversation to collaborators on Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiessuggestIntelliSense, Auto CompleteuxUser experience issuesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions