Skip to content
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

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

Closed
WebFreak001 opened this issue Jun 4, 2020 · 12 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities suggest IntelliSense, Auto Complete ux User experience issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@WebFreak001
Copy link

  • 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.

@dbaeumer dbaeumer assigned jrieken and unassigned dbaeumer Jun 5, 2020
@jrieken jrieken added help wanted Issues identified as good community contribution opportunities suggest IntelliSense, Auto Complete ux User experience issues feature-request Request for new features or functionality labels Jun 5, 2020
@jrieken jrieken added this to the Backlog milestone Jun 5, 2020
@jrieken jrieken changed the title CompletionItem.detail reordered + formatted / not used as is Donn't render newline-characters as new lines in suggest details widget Jun 5, 2020
@jrieken jrieken modified the milestones: Backlog, October 2020 Oct 5, 2020
@jrieken
Copy link
Member

jrieken commented Oct 5, 2020

Let's try this for October...

Screenshot 2020-10-05 at 11 52 05

@jrieken jrieken closed this as completed in ec0195d Oct 5, 2020
@WebFreak001
Copy link
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.

@jrieken
Copy link
Member

jrieken commented Oct 5, 2020

instead my issue was that the small preview had mixed up the string somehow and

Yeah, it will always do that because it needs to wrap lines because of spacing and to honour the actual line breaks. That's why it is always a mess

@WebFreak001
Copy link
Author

why was the string void writeln(\n\tT...\n)(\n\tT args\n) cut to void writeln( ) T and not cut to void writeln( T ) though?

@jrieken
Copy link
Member

jrieken commented Oct 23, 2020

Reopen for discussion

@jrieken jrieken reopened this Oct 23, 2020
@MartinGC94
Copy link

I was sent here from this comment: #29126 (comment) but I'm not sure what to say. It doesn't seem like anyone here wanted newlines removed from the detailed view, so let's just not do that.

I don't personally care about the small view, but I agree with the OP that it's weird if void writeln(\n\tT...\n)(\n\tT args\n) gets shortened to void writeln( ) T in the small view.

@jrieken
Copy link
Member

jrieken commented Oct 26, 2020

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

@jrieken jrieken closed this as completed Oct 26, 2020
@jrieken jrieken added the verification-needed Verification of issue is requested label Oct 26, 2020
@jrieken
Copy link
Member

jrieken commented Oct 26, 2020

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

@jrieken
Copy link
Member

jrieken commented Oct 27, 2020

@Tyriar for verification

@jrieken
Copy link
Member

jrieken commented Oct 27, 2020

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.

@JacksonKearl JacksonKearl added the verified Verification succeeded label Oct 28, 2020
@JacksonKearl
Copy link
Contributor

Spot on.
image

@Tyriar
Copy link
Member

Tyriar commented Oct 29, 2020

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 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities suggest IntelliSense, Auto Complete ux User experience issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@jrieken @dbaeumer @WebFreak001 @Tyriar @JacksonKearl @MartinGC94 and others