Declarations::OnAutoComplete Method (IVsTextView^, String^, Char, Int32)
Called after the declaration has been committed to the source file. When implemented in a derived class, it provides a completion character which may itself be a trigger for another round of IntelliSense.
Assembly: Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)
public: virtual wchar_t OnAutoComplete( IVsTextView^ textView, String^ committedText, wchar_t commitCharacter, int index )
Parameters
- textView
-
Type:
Microsoft.VisualStudio.TextManager.Interop::IVsTextView^
[in] An IVsTextView object representing the view that displays the source file.
- committedText
-
Type:
System::String^
[in] A string containing the text that was inserted as part of the completion process.
- commitCharacter
-
Type:
System::Char
[in] The character that was used to commit the text to the source file.
- index
-
Type:
System::Int32
[in] The index of the item that was committed to the source file.
Return Value
Type: System::CharReturns a character to be inserted after the committed text. If nothing is to be inserted, returns 0.
After text has been committed to the source file, this method is called to complete the characters already committed. For example, in the XML editor, if the user selects a start tag ("<tag"), this method is used to insert the end tag automatically ("></tag>"). The framework makes sure this method is called after Visual Studio has actually inserted the result from OnCommit, in this case "<tag".
This method can also be used to start another commitment based on the character that is returned. For example, if a method name is committed to the source file and the OnAutoComplete method returns an open parenthesis ("("), the "(" could then trigger the IntelliSense method tip operation.
The base method does nothing and returns 0.