Freigeben über


Completor(LanguageService, IVsTextView, String) Constructor

Definition

Initializes a new instance of the Completor class.

public:
 Completor(Microsoft::VisualStudio::Package::LanguageService ^ langsvc, Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ view, System::String ^ description);
public Completor (Microsoft.VisualStudio.Package.LanguageService langsvc, Microsoft.VisualStudio.TextManager.Interop.IVsTextView view, string description);
new Microsoft.VisualStudio.Package.Completor : Microsoft.VisualStudio.Package.LanguageService * Microsoft.VisualStudio.TextManager.Interop.IVsTextView * string -> Microsoft.VisualStudio.Package.Completor
Public Sub New (langsvc As LanguageService, view As IVsTextView, description As String)

Parameters

langsvc
LanguageService

[in] A LanguageService object.

view
IVsTextView

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

description
String

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

Remarks

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.

Applies to