Partager via


ICodeLensProvider.TryCreateCodeLensAsync Method

Definition

Creates an CodeLens, on request, from a given code element.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.CodeLens?> TryCreateCodeLensAsync (Microsoft.VisualStudio.Extensibility.Editor.CodeElement codeElement, Microsoft.VisualStudio.Extensibility.Editor.CodeElementContext codeElementContext, System.Threading.CancellationToken token);
abstract member TryCreateCodeLensAsync : Microsoft.VisualStudio.Extensibility.Editor.CodeElement * Microsoft.VisualStudio.Extensibility.Editor.CodeElementContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.CodeLens>
Public Function TryCreateCodeLensAsync (codeElement As CodeElement, codeElementContext As CodeElementContext, token As CancellationToken) As Task(Of CodeLens)

Parameters

codeElement
CodeElement

A code element in a document on which CodeLens provider is requested to provide CodeLens.

codeElementContext
CodeElementContext

Dynamic code element context at the point of request to create CodeLens.

token
CancellationToken

Cancellation token to observe.

Returns

An CodeLens created from the descriptor. Implement either InvokableCodeLens or VisualCodeLens.

Applies to