Roslyn: Minor, the async usage "example" in some tooltips is wrong

Created on 12 Nov 2019  路  7Comments  路  Source: dotnet/roslyn

Version Used: 16.3.5

Screenshot of the Issue:

If you mouse over the async keyword when it's applied to a lambda, you get this:
image

That usage example otherwise shows Usage: await functionname(...);, and while I generally find all of these usage examples useless, if they're there they might as well be correct. await() is not even valid syntax.

Area-IDE Concept-Continuous Improvement IDE-IntelliSense

All 7 comments

Now that I think about it, it simply should not be there for lambda functions, there's no way to explicitly call await on them.

@myblindy any lambda function that is equivalent to a Func<..., Task> is awaitable.

Sure, but the syntax of await () is still not valid. It's like it's trying to get the name and put it between the await and (), but it gets null and displays nothing (obviously, since anonymous lambda functions have no name).

Honestly, at thsi point, i don't see the usage: await ... being useful anymore.

I agree, yeah.

I'm bringing this to the design meeting tomorrow to decide between the following:

  1. Remove this text if the function does not have a name (addresses this bug without removing the feature)
  2. Remove this text altogether (clean up the Quick Info to make room for other more valuable information)

Design Meeting Notes:

We would like to use this opportunity to clean up Quick Info by removing this text altogether.

(Note that the "Usage:" label can still be shown in the case of multitargeted projects where APIs are available only on a strict subset of targets.)

Was this page helpful?
0 / 5 - 0 ratings