//
// 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.DataProtocol.Contracts.Common;
using Microsoft.SqlTools.Hosting.Contracts;
namespace Microsoft.SqlTools.DataProtocol.Contracts
{
public enum TraceOptions
{
Off,
Messages,
Verbose
}
///
/// Parameters provided with an initialize request
///
///
/// This is the initialize request parameters used by VSCode language server. These are
/// provided here for convenience of implementing initialization request handlers when the
/// server is expected to be used by the VSCode language client. You are not obligated to use
/// these initialization params when writing your server, nor are you even obligated to
/// implement an initialize handler. However, the VSCode language client will always send an
/// initialize request when starting the server and will not consider the server "ready" until
/// a response to the init request has been received.
///
public class InitializeParameters
{
///
/// Capabilities of the initializing client
///
public ClientCapabilities.ClientCapabilities Capabilities { get; set; }
///
/// Root path of the workspace, is null if no folder is open.
///
///
/// This function has been deprecated in favor of workspace folders
///
[Obsolete("Deprecated in favor of rootUri")]
public string RootPath { get; set; }
///
/// Root URI of the workspace, is null if no folder is open. If both
/// and are set, should be used.
///
///
/// This function has been deprecated in favor of workspace folders
///
[Obsolete("Deprecated in favor of workspace folders")]
public string RootUri { get; set; }
///
/// Initial trace setting. If omitted, trace is disabled
///
public TraceOptions? Trace { get; set; }
///
/// Workspace folders that are open at the time of initialization. If this is provided, it
/// takes precedence over and
///
public WorkspaceFolder[] WorkspaceFolders { get; set; }
}
///
/// Parameters provided as a result to an initialize request
///
///
/// This is the initialize result parameters used by VSCode language server. These are provided
/// for convenience of implementing initialization request handlers when the server is expected
/// to be used by the VSCode language client. You are not obligated to use these initialization
/// params when writing your server, nor are you even obligated to implement an initialize
/// handler. However, the VSCode language client will always send an initialize request when
/// starting the server and will not consider the server "ready" until a response to the init
/// request has been received.
///
public class InitializeResponse
{
///
/// Capabilities that this server provides
///
public ServerCapabilities.ServerCapabilities Capabilities { get; set; }
}
public class InitializeRequest
{
public static readonly RequestType Type =
RequestType.Create("initialize");
}
}