Share via


ILanguageClient.ActivateAsync(CancellationToken) Method

Definition

This method is called by Visual Studio to notify the extension that the LSP server should be started.

public:
 System::Threading::Tasks::Task<Microsoft::VisualStudio::LanguageServer::Client::Connection ^> ^ ActivateAsync(System::Threading::CancellationToken token);
public System.Threading.Tasks.Task<Microsoft.VisualStudio.LanguageServer.Client.Connection> ActivateAsync (System.Threading.CancellationToken token);
public System.Threading.Tasks.Task<Microsoft.VisualStudio.LanguageServer.Client.Connection?> ActivateAsync (System.Threading.CancellationToken token);
abstract member ActivateAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.LanguageServer.Client.Connection>
Public Function ActivateAsync (token As CancellationToken) As Task(Of Connection)

Parameters

token
CancellationToken

Cancellation token.

Returns

A Connection object; or null if the language server cannot be started.

Remarks

Any exceptions thrown here will be caught and displayed to users.

This method is normally called by Visual Studio while handling the StartAsync event, before returning from such event. Visual Studio can call ActivateAsync(CancellationToken) again, in case the Connection with the server is closed, in order to activate the server again.

Applies to