Class ServiceHost
SQL Tools VS Code Language Server request handler. Provides the entire JSON RPC implementation for sending/receiving JSON requests and dispatching the requests to handlers that are registered prior to startup.
Namespace:Microsoft.SqlTools.ServiceLayer.Hosting
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public sealed class ServiceHost : ServiceHostBase, IProtocolEndpoint, IMessageSender
Properties
| Improve this Doc View SourceInstance
Current instance of the ServiceHost
Declaration
public static ServiceHost Instance { get; }
Type | Description |
---|---|
ServiceHost |
Methods
| Improve this Doc View SourceInitialize()
Provide initialization that must occur after the service host is started
Declaration
public void Initialize()
RegisterInitializeTask(ServiceHost.InitializeCallback)
Add a new method to be called when the initialize request is submitted
Declaration
public void RegisterInitializeTask(ServiceHost.InitializeCallback callback)
Parameters
Type | Name | Description |
---|---|---|
ServiceHost.InitializeCallback | callback | Callback to perform when an initialize request is submitted |
RegisterShutdownTask(ServiceHost.ShutdownCallback)
Adds a new callback to be called when the shutdown request is submitted
Declaration
public void RegisterShutdownTask(ServiceHost.ShutdownCallback callback)
Parameters
Type | Name | Description |
---|---|---|
ServiceHost.ShutdownCallback | callback | Callback to perform when a shutdown request is submitted |