EditSpan Class

 

Describes an edit operation.

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

System.Object
  Microsoft.VisualStudio.Package.EditSpan

[CLSCompliantAttribute(false)]
public class EditSpan

NameDescription
System_CAPS_pubmethodEditSpan(TextSpan, String)

Initializes a new instance of the EditSpan class.

NameDescription
System_CAPS_pubpropertyLengthOfLastLine

Returns the length of the last line in the replacement text.

System_CAPS_pubpropertyLineCount

Returns the number of lines in the replacement text.

System_CAPS_pubpropertySpan

Determines the span to be replaced.

System_CAPS_pubpropertyText

Determines the replacement text.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

This class is used with the EditArray class to manage and apply edit operations. This class describes either a replacement or insertion operation, using a span and the new text. A deletion operation is a special case of a replacement where the replacement string is empty.

Set up a span that describes the text to replace and specify the text to replace with. When the edit operation is applied, the span is completely replaced by the new text.

Set up a span that describes the point of insertion but has no length; that is, the end point is the same as the start point. When the edit operation is applied, the new text is inserted at the specified point.

The delete operation is a special case of the replace operation. Set up a span that describes the text to delete and specify an empty string for the replacement text. When the edit operation is applied, the span is completely replaced by the new text, which in this case is an empty string. Since a span can describe multiple lines, whole lines can be deleted this way.

Notes to Implementers:

This class contains all the functionality needed to describe an edit operation. There is no need to derive from this class.

Notes to Callers:

Instantiate this class with a TextSpan object and a string to describe a single edit operation.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: