Partager via


IFindFilesService.FindFilesAsync Method

Definition

Searches the workspace for files matching a pattern.

public System.Threading.Tasks.Task FindFilesAsync (string query, IProgress<string> progress, System.Threading.CancellationToken cancellationToken = default);
abstract member FindFilesAsync : string * IProgress<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function FindFilesAsync (query As String, progress As IProgress(Of String), Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

query
String

The query to match filenames on. It may be matched based on substring or a richer parsing of the files.

progress
IProgress<String>

Receives the full path to each file as it is discovered.

cancellationToken
CancellationToken

A token whose cancellation will cancel the query.

Returns

A task that completes when all match files have been reported.

Exceptions

Thrown when query is null, empty, or contains invalid characters.

Thrown when progress is null.

Thrown when cancellationToken indicates that cancellation has been requested.

Thrown when enumeration of the files cannot proceed because of an unexpected IO problem.

Applies to