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

Add optional width parameter to GetToolTip #14891

Merged
merged 5 commits into from Mar 15, 2023
Merged

Conversation

dawedawe
Copy link
Contributor

fixes #13772
with help of @nojaf

If provided, use the given width to call Display.squashTo on the layout of the ToolTip.

We were able to demonstrate the effects this would have in Rider:

Default behaviour with no width provided:

Screenshot 2023-03-14 111939

With width 20 for demo purposes:
Screenshot 2023-03-14 111732

if provided, use the given width to call Display.squashTo on the layout
@vzarytovskii
Copy link
Member

It doesn't change the default current behaviour, right?

@dawedawe
Copy link
Contributor Author

No, if no width is provided, the layout isn't modified in any way.

@majocha
Copy link
Contributor

majocha commented Mar 14, 2023

Will it squash doc comments, too?

@dawedawe
Copy link
Contributor Author

No, but you might see them rendered in a window with a smaller width. But that depends on the caller of the API.
Here's the current rendering of Rider without the width given:

Screenshot 2023-03-14 152936

Here with a width given:

Screenshot 2023-03-14 152742

You can get the same change in the rendering of the doc comment if you drag the tooltip window with your mouse to a smaller width. But this PR dosn't add newlines to doc comments.

@dawedawe dawedawe marked this pull request as ready for review March 14, 2023 16:03
@dawedawe dawedawe requested a review from a team as a code owner March 14, 2023 16:03
Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, thanks, @dawedawe!

BTW what happens in case of some horribly long word or type? Like

type Donaudampfschiffahrtselektrizitätenhauptbetriebswerkbauunterbeamtengesellschaft = int

It's a corner case anyway, I'm just curious, would be grateful for a screenshot :)

@dawedawe
Copy link
Contributor Author

dawedawe commented Mar 14, 2023

First, you'll get an Ehrenmitgliedschaft in some German language club 😜
Second, the word is honored and not broken. The breaks only happen between words in the signature.

Screenshot 2023-03-14 200603

@psfinaki
Copy link
Member

@dawedawe alright, now I can sleep peacefully :D thanks for checking that!

@vzarytovskii vzarytovskii merged commit ddcf976 into dotnet:main Mar 15, 2023
22 checks passed
kant2002 pushed a commit to kant2002/fsharp that referenced this pull request Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add optional width parameter for FSharpCheckFileResults.GetToolTip
6 participants