Compartilhar via


ITextDocumentSnapshot.GetEditorOptionValueAsync<T> Method

Definition

Gets an editor option value based on the current text document scope.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.EditorOptionValue<T?>> GetEditorOptionValueAsync<T> (Microsoft.VisualStudio.Extensibility.Editor.TextDocumentOption<T> option, System.Threading.CancellationToken cancellationToken);
abstract member GetEditorOptionValueAsync : Microsoft.VisualStudio.Extensibility.Editor.TextDocumentOption<'T> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Extensibility.Editor.EditorOptionValue<'T>>
Public Function GetEditorOptionValueAsync(Of T) (option As TextDocumentOption(Of T), cancellationToken As CancellationToken) As Task(Of EditorOptionValue(Of T))

Type Parameters

T

Type of the option value.

Parameters

option
TextDocumentOption<T>

Option identifier.

cancellationToken
CancellationToken

Cancellation token to monitor.

Returns

This method returns either:

  • the current value of option.
  • the defined default value if option is defined but not set.

Exceptions

Throw when option is not set in this scope.

Applies to