mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-01 17:24:42 -05:00
* Make nullable warnings a per file opt-in * Remove unneeded compiler directives * Remove compiler directive for User Data
55 lines
1.4 KiB
C#
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; }
|
|
}
|
|
}
|