SQL Tools Service
Show / Hide Table of Contents
Improve this Doc View Source

Class WorkspaceService<TConfig>

Class for handling requests/events that deal with the state of the workspace, including the opening and closing of files, the changing of configuration, etc.

Inheritance
System.Object
WorkspaceService<TConfig>
Namespace:Microsoft.SqlTools.ServiceLayer.Workspace
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class WorkspaceService<TConfig>
    where TConfig : class, new ()

Constructors

| Improve this Doc View Source

WorkspaceService()

Default, parameterless constructor. TODO: Figure out how to make this truely singleton even with dependency injection for tests

Declaration
public WorkspaceService()

Properties

| Improve this Doc View Source

CurrentSettings

Current settings for the workspace

Declaration
public TConfig CurrentSettings { get; }
Type Description
TConfig
| Improve this Doc View Source

Instance

Declaration
public static WorkspaceService<TConfig> Instance { get; }
Type Description
WorkspaceService<TConfig>
| Improve this Doc View Source

Workspace

Workspace object for the service. Virtual to allow for mocking

Declaration
public virtual Workspace Workspace { get; }
Type Description
Workspace

Methods

| Improve this Doc View Source

InitializeService(ServiceHost)

Declaration
public void InitializeService(ServiceHost serviceHost)
Parameters
Type Name Description
ServiceHost serviceHost
| Improve this Doc View Source

RegisterConfigChangeCallback(WorkspaceService<TConfig>.ConfigChangeCallback)

Adds a new task to be called when the configuration has been changed. Use this to handle changing configuration and changing the current configuration.

Declaration
public void RegisterConfigChangeCallback(WorkspaceService<TConfig>.ConfigChangeCallback task)
Parameters
Type Name Description
WorkspaceService.ConfigChangeCallback<> task

Task to handle the request

| Improve this Doc View Source

RegisterTextDocChangeCallback(WorkspaceService<TConfig>.TextDocChangeCallback)

Adds a new task to be called when the text of a document changes.

Declaration
public void RegisterTextDocChangeCallback(WorkspaceService<TConfig>.TextDocChangeCallback task)
Parameters
Type Name Description
WorkspaceService.TextDocChangeCallback<> task

Delegate to call when the document changes

| Improve this Doc View Source

RegisterTextDocCloseCallback(WorkspaceService<TConfig>.TextDocCloseCallback)

Adds a new task to be called when a text document closes.

Declaration
public void RegisterTextDocCloseCallback(WorkspaceService<TConfig>.TextDocCloseCallback task)
Parameters
Type Name Description
WorkspaceService.TextDocCloseCallback<> task

Delegate to call when the document closes

| Improve this Doc View Source

RegisterTextDocOpenCallback(WorkspaceService<TConfig>.TextDocOpenCallback)

Adds a new task to be called when a file is opened

Declaration
public void RegisterTextDocOpenCallback(WorkspaceService<TConfig>.TextDocOpenCallback task)
Parameters
Type Name Description
WorkspaceService.TextDocOpenCallback<> task

Delegate to call when a document is opened

  • Improve this Doc
  • View Source

© Microsoft  //  Generated with DocFX