Share via


IVsCustomClosedFileDocDataProvider.GetCustomDocDataForFilePathAsync Method

Definition

Called in Find scenarios to allow custom editors supply an IVsPersistDocData implementation for closed files. The IVsPersistDocData supplied by the custom editors should be the same one they supply to running document table when a file is opened in Visual Studio. The IVsPersistDocData implementation of the custom editor must also implement IVsTextLines and IVsUserData and expose the current ITextSnapshot

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Interop.IVsPersistDocData?> GetCustomDocDataForFilePathAsync (string filePath, System.Threading.CancellationToken cancellationToken);
abstract member GetCustomDocDataForFilePathAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Interop.IVsPersistDocData>
Public Function GetCustomDocDataForFilePathAsync (filePath As String, cancellationToken As CancellationToken) As Task(Of IVsPersistDocData)

Parameters

filePath
String
cancellationToken
CancellationToken

Returns

Examples

[Export(typeof(IVsCustomClosedFileDocDataProvider)) public class CustomClosedFileDocDataProvider: IVsCustomClosedFileDocDataProvider { public async Task<IVsPersistDocData> GetCustomDocDataForFilePathAsync(String, CancellationToken) { // Logic to return the custom IVsPersistDocData for the requested file path. } }

Remarks

Called from a background thread.

Applies to