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,45 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.LanguageServices;
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.Test.Completion
{
public class ScriptDocumentInfoTest
{
[Fact]
public void MetricsShouldGetSortedGivenUnSortedArray()
{
TextDocumentPosition doc = new TextDocumentPosition()
{
TextDocument = new TextDocumentIdentifier
{
Uri = "script file"
},
Position = new Position()
{
Line = 1,
Character = 14
}
};
ScriptFile scriptFile = new ScriptFile()
{
Contents = "Select * from sys.all_objects"
};
ScriptParseInfo scriptParseInfo = new ScriptParseInfo();
ScriptDocumentInfo docInfo = new ScriptDocumentInfo(doc, scriptFile, scriptParseInfo);
Assert.Equal(docInfo.StartLine, 1);
Assert.Equal(docInfo.ParserLine, 2);
Assert.Equal(docInfo.StartColumn, 44);
Assert.Equal(docInfo.EndColumn, 14);
Assert.Equal(docInfo.ParserColumn, 15);
}
}
}