//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using Microsoft.SqlTools.EditorServices.Session;
using Microsoft.SqlTools.LanguageSupport;
namespace Microsoft.SqlTools.EditorServices
{
///
/// Manages a single session for all editor services. This
/// includes managing all open script files for the session.
///
public class EditorSession : IDisposable
{
#region Properties
///
/// Gets the Workspace instance for this session.
///
public Workspace Workspace { get; private set; }
///
/// Gets or sets the Language Service
///
///
public LanguageService LanguageService { get; set; }
///
/// Gets the SqlToolsContext instance for this session.
///
public SqlToolsContext SqlToolsContext { get; private set; }
#endregion
#region Public Methods
///
/// Starts the session using the provided IConsoleHost implementation
/// for the ConsoleService.
///
///
/// Provides details about the host application.
///
///
/// An object containing the profile paths for the session.
///
public void StartSession(HostDetails hostDetails, ProfilePaths profilePaths)
{
// Initialize all services
this.SqlToolsContext = new SqlToolsContext(hostDetails, profilePaths);
this.LanguageService = new LanguageService(this.SqlToolsContext);
// Create a workspace to contain open files
this.Workspace = new Workspace(this.SqlToolsContext.SqlToolsVersion);
}
#endregion
#region IDisposable Implementation
///
/// Disposes of any Runspaces that were created for the
/// services used in this session.
///
public void Dispose()
{
}
#endregion
}
}