//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
using System.Diagnostics;
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion
{
///
/// Includes the objects created by auto completion service
///
public class AutoCompletionResult
{
///
/// Creates new instance
///
public AutoCompletionResult()
{
Stopwatch = new Stopwatch();
Stopwatch.Start();
}
private Stopwatch Stopwatch { get; set; }
///
/// Completes the results to calculate the duration
///
public void CompleteResult(CompletionItem[] completionItems)
{
Stopwatch.Stop();
CompletionItems = completionItems;
}
///
/// The number of milliseconds to process the result
///
public double Duration
{
get
{
return Stopwatch.ElapsedMilliseconds;
}
}
///
/// Completion list
///
public CompletionItem[] CompletionItems { get; private set; }
}
}