SampleCompletionProviders
Sample of Microsoft.CodeAnalysis.Completion.CompletionProvider interface usage
There are 3 classes implementing it:
- ConfigureAwaitCompletionProvider - suggests
ConfigureAwait(false)
onTask
, so you don't have type that open paren, false, close paren. Described on DotVVM blog article - PostfixTemplateCompletionProvider - suggests
not
"field" onbool
witch is expanded to!(...)
expression after commitreturn
field onvoid
witch is expanded to return statement following the current statement
- ReflectionGetMemberCompletionProvider - suggests members of type in
typeof(TheType).GetMethod/GetField/GetProperty/GetMember("...")
expression
See article on DotVVM blog for more information how this works. And source code of the individual classes, they contain a lot of comments although it's agains my practise :).
The full documentation is at http://source.roslyn.io, specificaly have a look at Microsoft.CodeAnalysis.Completion.CompletionProvider and its implementations