Skip to content

Conversation

@danii
Copy link
Contributor

@danii danii commented Jan 28, 2022

Adds the return type of keywords to tool-tips where it makes sense. This applies to: if, else, match, loop, unsafe and await. Thanks to @Veykril for sharing the idea of putting return type highlighting on other keywords!
image

Closes #11359

@danii danii changed the title Add Keyword Return Type Highlighting Add Keyword Return Type Tooltip Jan 28, 2022
@Veykril Veykril changed the title Add Keyword Return Type Tooltip feat: Add type hint for keyword expression hovers Jan 31, 2022
Cleaned up the code for keyword expression hovers.

Added a check to hide units `()` in keyword expression hovers.
@danii
Copy link
Contributor Author

danii commented Feb 14, 2022

Sorry for the small delay.

I was also debating on whether or not units should really be hidden from the hover/tooltip/whatever but I noticed there is precedence.
image

Hopefully this all looks good.

@danii danii requested a review from Veykril February 14, 2022 20:31
@danii
Copy link
Contributor Author

danii commented Feb 14, 2022

Also it doesn't look like try gets it's return type, or even keyword documentation...
image

@Veykril
Copy link
Member

Veykril commented Feb 14, 2022

Also it doesn't look like try gets it's return type, or even keyword documentation...

That's because it has no documentation in the standard library yet(given its an unstable feature)

Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Lgtm thanks!
bors r+

@bors
Copy link
Contributor

bors bot commented Feb 14, 2022

@bors bors bot merged commit aafa40c into rust-lang:master Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Return Type Tooltip For .await

2 participants