Proposal.ValidateEdits Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determine if a sequence of edits is valid given the caret
position and an optional completionState
.
public static bool ValidateEdits (System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> edits, Microsoft.VisualStudio.Text.VirtualSnapshotPoint caret, Microsoft.VisualStudio.Language.Proposals.CompletionState? completionState = default);
static member ValidateEdits : System.Collections.Generic.IReadOnlyList<Microsoft.VisualStudio.Language.Proposals.ProposedEdit> * Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Language.Proposals.CompletionState -> bool
Public Shared Function ValidateEdits (edits As IReadOnlyList(Of ProposedEdit), caret As VirtualSnapshotPoint, Optional completionState As CompletionState = Nothing) As Boolean
Parameters
- edits
- IReadOnlyList<ProposedEdit>
- caret
- VirtualSnapshotPoint
- completionState
- CompletionState
Returns
false if any of the edits violate the constraints below.
Remarks
Proposals are only valid if: If completionState
is non-null then ApplicableToSpan must be on the same ITextSnapshot as caret
and caret
must be contained in the ApplicableToSpan. No edits intersect any other edit. If completionState
is non-null, then any edit that intersects ApplicableToSpan must be a zero-length span that starts at the end of ApplicableToSpan. Otherwise, any edit that intersects the caret must have a length of zero.