-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEFeature Requesthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Brief description:
#47511 added support for completion of unnamed symbols. During the implementation it was suggested to add completion support for await and await someTask.ConfigureAwait(false).
This idea was postponed to not further complicate the PR:
#47511 (comment)
This feature would mimic dotnet/csharplang#4076 to some extent without actually implementing it as a language feature.
Languages applicable:
C#
Code example for the completion:
someTask.aw$$ // this triggers completion which contains "await" and "awaitf".
// committed suggestions ("await"):
await someTask$$
// or ("awaitf")
await someTask.ConfigureAwait(false)$$Additional information:
The following characteristics would apply:
- Triggered after dot on the left side of the cursor (this includes null conditional member access)
- Expression on the left side of the dot must be task like
- Containing method must be marked with
async - Completion list contains
awaitandawaitf - Completion items are sorted alphabetical in between other members
- The completion item is an operator (operator glyph and filtered by the operator selection)
- The
SymbolCompletionItemneeds an underlying symbol. I think,Task.ContinueWithis a good choice, but causes some trouble with quick info (XMLDoc comment does not fit, overload count is just wrong and it will be difficult to prevent the completion list from merging the symbol with the realContinueWithmethod symbols). It's propably better to synthesize a symbol, like it was done for the built-in conversions in Intellisense for cast, indexers and operators #47511. - On completion,
awaitis placed in front of the expression. Thedot, that triggered completion and any partially writtenawaitis removed. - On null conditional member access, the
?is left. This is in line with the behavior of conversion completion. - On completion of awaitf,
.ConfigureAwait(false)is additionally appended to thedotleft of the cursor position - Completion for null conditional member access and
awaitf(someTask?.$$) completes toawait someTask.ConfigureAwait(false)?$$ - Completion does not surround the resulting expression with parenthesis like so
(await someTask)$$
Metadata
Metadata
Assignees
Labels
Area-IDEFeature Requesthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it