mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 01:25:40 -05:00
adding a new event for when definition is requested (#167)
* sending telemetry events for intellisense usage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user