IVsCustomClosedFileDocDataProvider.GetCustomDocDataForFilePathAsync 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.
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.