Completor Constructor (LanguageService^, IVsTextView^, String^)

 

Initializes a new instance of the Completor class.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
Completor(
	LanguageService^ langsvc,
	IVsTextView^ view,
	String^ description
)

Parameters

langsvc
Type: Microsoft.VisualStudio.Package::LanguageService^

[in] A LanguageService object.

view
Type: Microsoft.VisualStudio.TextManager.Interop::IVsTextView^

[in] An IVsTextView representing the view currently being edited.

description
Type: System::String^

[in] A string used to describe the pending edit operation.

This constructor performs the following actions

  • Caches the parameters for later use.

  • Calls the GetSource method on the LanguageService object to get the Source object representing the source that is about to be updated.

  • Creates a new StringBuilder object to manage insertions and deletions into the line of text. This object holds only the text that is to be inserted at the current caret position.

  • Creates a new CompoundAction object to wrap all changes in a single edit operation.

  • Obtains the starting caret position by calling the GetCaretPos method on the IVsTextView object. This is where the new text is to be inserted.

  • Calls the RefreshLine method to obtain the current line of text to change.

  • Sets the internal caret position to 0. This reflects the offset from the starting caret position as new characters are inserted.

  • Calls the GetIVsTextMacroHelperIfRecordingOn method on the LanguageService object to cache any active macro recorder.

Return to top
Show: