mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-25 17:24:17 -05:00
Add v2 of the Hosting Service and build nuget packages for it (#675)
* Port v2 of Hosting service to SqlToolsService - Renamed project to .v2 so that existing hosted service isn't impacted - Copied over the CoreServices project which contains ConnectionServiceCore and other reusable services for anything interacting with MSSQL - Ported unit test project across and verified tests run. * Nuget package support for reusable DLLs * Use 1.1 version per Karl's suggestion * Use correct license URL and project URL * Use new SMO packages
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.SqlTools.Hosting.Contracts;
|
||||
|
||||
namespace Microsoft.SqlTools.CoreServices.LanguageServices.Contracts
|
||||
{
|
||||
public class TelemetryProperties
|
||||
{
|
||||
public string EventName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Telemetry properties
|
||||
/// </summary>
|
||||
public Dictionary<string, string> Properties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Telemetry measures
|
||||
/// </summary>
|
||||
public Dictionary<string, double> Measures { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parameters sent back with an IntelliSense ready event
|
||||
/// </summary>
|
||||
public class TelemetryParams
|
||||
{
|
||||
public TelemetryProperties Params { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event sent when the language service needs to add a telemetry event
|
||||
/// </summary>
|
||||
public class TelemetryNotification
|
||||
{
|
||||
public static readonly
|
||||
EventType<TelemetryParams> Type =
|
||||
EventType<TelemetryParams>.Create("telemetry/sqlevent");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of telemetry events
|
||||
/// </summary>
|
||||
public static class TelemetryEventNames
|
||||
{
|
||||
/// <summary>
|
||||
/// telemetry event name for auto complete response time
|
||||
/// </summary>
|
||||
public const string IntellisenseQuantile = "IntellisenseQuantile";
|
||||
|
||||
/// <summary>
|
||||
/// telemetry event name for when definition is requested
|
||||
/// </summary>
|
||||
public const string PeekDefinitionRequested = "PeekDefinitionRequested";
|
||||
|
||||
/// <summary>
|
||||
/// telemetry event name for when definition is requested
|
||||
/// </summary>
|
||||
public const string FormatCode = "FormatCode";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of properties used in telemetry events
|
||||
/// </summary>
|
||||
public static class TelemetryPropertyNames
|
||||
{
|
||||
/// <summary>
|
||||
/// Is a connection to an Azure database or not
|
||||
/// </summary>
|
||||
public const string IsAzure = "IsAzure";
|
||||
|
||||
/// <summary>
|
||||
/// Did an event succeed or not
|
||||
/// </summary>
|
||||
public const string Succeeded = "Succeeded";
|
||||
|
||||
/// <summary>
|
||||
/// Was the action against a connected file or similar resource, or not
|
||||
/// </summary>
|
||||
public const string Connected = "Connected";
|
||||
|
||||
/// <summary>
|
||||
/// Format type property - should be one of <see cref="DocumentFormatType"/> or <see cref="RangeFormatType"/>
|
||||
/// </summary>
|
||||
public const string FormatType = "FormatType";
|
||||
|
||||
/// <summary>
|
||||
/// A full document format
|
||||
/// </summary>
|
||||
public const string DocumentFormatType = "Document";
|
||||
|
||||
/// <summary>
|
||||
/// A document range format
|
||||
/// </summary>
|
||||
public const string RangeFormatType = "Range";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user