CompletionProviders
are IDE extensions that provide completion items in the intellisense list when user is editing code in the Visual Studio IDE:
The preceding screenshot shows a completion list with all the accessible instance members from the current type and base types, and is generally shown when the user types this.
inside executable code. Users can hit a commit character, such as Enter key, to invoke auto-complete with the chosen member.
In this section, we will write a CompletionProvider
to provide the same accessible members completion items, but without requiring the user to have typed a this
before a .
character (yay! from all the lazy folks like me). Additionally, when invoked within a static method, the completion provider will provide only static accessible members in the completion list.