adding a new event for when definition is requested (#167)

* sending telemetry events for intellisense usage
This commit is contained in:
Leila Lali
2016-12-08 14:05:42 -08:00
committed by GitHub
parent 54f30887cc
commit 0b295e78c2
16 changed files with 848 additions and 147 deletions

View File

@@ -0,0 +1,54 @@
//
// 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 System.Diagnostics;
using Microsoft.SqlServer.Management.SqlParser.Intellisense;
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion
{
/// <summary>
/// Includes the objects created by auto completion service
/// </summary>
public class AutoCompletionResult
{
/// <summary>
/// Creates new instance
/// </summary>
public AutoCompletionResult()
{
Stopwatch = new Stopwatch();
Stopwatch.Start();
}
private Stopwatch Stopwatch { get; set; }
/// <summary>
/// Completes the results to calculate the duration
/// </summary>
public void CompleteResult(CompletionItem[] completionItems)
{
Stopwatch.Stop();
CompletionItems = completionItems;
}
/// <summary>
/// The number of milliseconds to process the result
/// </summary>
public double Duration
{
get
{
return Stopwatch.ElapsedMilliseconds;
}
}
/// <summary>
/// Completion list
/// </summary>
public CompletionItem[] CompletionItems { get; private set; }
}
}