Compartilhar via


IAsyncCompletionSession.ShouldCommit Method

Definition

Returns whether given text edit should result in committing this session. Since this method is on a typing hot path, it returns quickly if the typedChar is not found among characters collected from PotentialCommitCharacters Else, we map the top-buffer triggerLocation to subject buffers and query ShouldCommitCompletion(IAsyncCompletionSession, SnapshotPoint, Char, CancellationToken) to see whether any IAsyncCompletionCommitManager would like to commit completion. Must be called on UI thread.

public:
 bool ShouldCommit(char typedChar, Microsoft::VisualStudio::Text::SnapshotPoint triggerLocation, System::Threading::CancellationToken token);
public bool ShouldCommit (char typedChar, Microsoft.VisualStudio.Text.SnapshotPoint triggerLocation, System.Threading.CancellationToken token);
abstract member ShouldCommit : char * Microsoft.VisualStudio.Text.SnapshotPoint * System.Threading.CancellationToken -> bool
Public Function ShouldCommit (typedChar As Char, triggerLocation As SnapshotPoint, token As CancellationToken) As Boolean

Parameters

typedChar
Char

The text edit which caused this action. May be null.

triggerLocation
SnapshotPoint

Location on the view's data buffer: TextBuffer

token
CancellationToken

Token used to cancel this operation

Returns

Whether any ShouldCommitCompletion(IAsyncCompletionSession, SnapshotPoint, Char, CancellationToken) returned true

Remarks

This method must run on UI thread because of mapping the point across buffers.

Applies to