Files
sqltoolsservice/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Completion/AutoCompletionResult.cs
Karl Burtram f288bee294 Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in

* Remove unneeded compiler directives

* Remove compiler directive for User Data
2023-02-03 18:10:07 -08:00

55 lines
1.4 KiB
C#

//
// 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
{
/// <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; }
}
}