Share via


Completor.Apply Method

Applies all changes made through the Completor object.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Sub Apply
public void Apply()
public:
void Apply()
member Apply : unit -> unit
public function Apply()

Remarks

This method calls the ReplaceTextOnLine method on the IVsTextView object that was passed to the Completor class constructor. This method then disposes off the CompoundAction object created in the constructor. Finally, the text view's caret position is updated (with a call to the SetCaretPos method on the IVsTextView object) based on the internal caret position stored in the Completor object.

Note

If a newline character was added to the line, the resulting text appears in the text view as multiple lines. However, the internal caret position does not take into account multiple lines so the text view's final caret position may not be where you expect.

.NET Framework Security

See Also

Reference

Completor Class

Microsoft.VisualStudio.Package Namespace