Partager via


IAsyncCompletionSource.TryGetApplicableToSpan Method

Definition

Provides the span applicable to the prospective session. Called on UI thread and expected to return very quickly, based on textual information. This method is called sequentially on available IAsyncCompletionSources until one of them returns true. Returning false does not exclude this source from participating in completion session. If no IAsyncCompletionSources return true, there will be no completion session.

public:
 bool TryGetApplicableToSpan(char typedChar, Microsoft::VisualStudio::Text::SnapshotPoint triggerLocation, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Text::SnapshotSpan % applicableToSpan, System::Threading::CancellationToken token);
public bool TryGetApplicableToSpan (char typedChar, Microsoft.VisualStudio.Text.SnapshotPoint triggerLocation, out Microsoft.VisualStudio.Text.SnapshotSpan applicableToSpan, System.Threading.CancellationToken token);
abstract member TryGetApplicableToSpan : char * Microsoft.VisualStudio.Text.SnapshotPoint * SnapshotSpan * System.Threading.CancellationToken -> bool
Public Function TryGetApplicableToSpan (typedChar As Char, triggerLocation As SnapshotPoint, ByRef applicableToSpan As SnapshotSpan, token As CancellationToken) As Boolean

Parameters

typedChar
Char

Character typed by the user

triggerLocation
SnapshotPoint

Location on the subject buffer that matches this IAsyncCompletionSource's content type

applicableToSpan
SnapshotSpan

Applicable span for the prospective completion session. You may set it to default if returning false

token
CancellationToken

Cancellation token that may interrupt this operation

Returns

Whether completion should use the supplied applicable span.

Remarks

A language service should provide the span and return true even if it does not wish to provide completion. This will enable extensions to provide completion in syntactically appropriate location.

Applies to