Update Infrastructure (#961)

* Update form .NET Core 2.2 to .NET Core 3.1

- Global variable for projects
- Change TFMs from netcoreapp2.2 to netcoreapp3.1
- Update global.json
- Update build.json
- Remove direct framework cake TestCore task
- Update travis dotnet version
- Update azure pipline file
- Update vscode launch.json

* Add Central Package Management

* Fix xUnit Breaking Change for MemberData type

* Fix xUnit breaking change for duplicate test method name

* Fix Rang/Index type conflict with System.Rang/Index

* Update vscode tasks.json

* Change serviceHostExecutable path in ServiceTestDriver.cs

* Downgrade SDK version (https://github.com/appveyor/ci/issues/3440)

- Appveyor hasn't installed latest SDK therefore I downgrade it until they install it.

* Dump Microsoft.SqlServer.DACFx
This commit is contained in:
Soheil Alizadeh
2020-06-12 23:14:18 +04:30
committed by GitHub
parent c51a59dadf
commit 887a499d2b
62 changed files with 704 additions and 771 deletions

View File

@@ -7,7 +7,7 @@ os:
# - osx # - osx
mono: none mono: none
dotnet: 2.2 dotnet: 3.1
# was dotnet: 2.2.100-preview3-009430 # was dotnet: 2.2.100-preview3-009430
# safelist # safelist

2
.vscode/launch.json vendored
View File

@@ -10,7 +10,7 @@
"request": "launch", "request": "launch",
"preLaunchTask": "build", "preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path. // If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer/bin/Debug/netcoreapp2.2/MicrosoftSqlToolsServiceLayer.dll", "program": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer/bin/Debug/netcoreapp3.1/MicrosoftSqlToolsServiceLayer.dll",
"args": [], "args": [],
"cwd": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer", "cwd": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window

2
.vscode/tasks.json vendored
View File

@@ -7,7 +7,7 @@
"type": "process", "type": "process",
"args": [ "args": [
"build", "build",
"${workspaceFolder}/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj" "${workspaceFolder}/sqltoolsservice.sln"
], ],
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
} }

View File

@@ -1,16 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<SmoPackageVersion>160.2004021.0</SmoPackageVersion>
<SqlClientPackageVersion>1.1.1</SqlClientPackageVersion>
<NewtonsoftPackageVersion>11.0.1</NewtonsoftPackageVersion>
<DacFxPackageVersion>150.4787.1-preview</DacFxPackageVersion>
<HighEntropyVA>true</HighEntropyVA> <HighEntropyVA>true</HighEntropyVA>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="$(SqlClientPackageVersion)" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="$(DacFxPackageVersion)" GeneratePathProperty="true" />
</ItemGroup>
</Project> </Project>

3
Directory.Build.targets Normal file
View File

@@ -0,0 +1,3 @@
<Project>
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.52" />
</Project>

30
Packages.props Normal file
View File

@@ -0,0 +1,30 @@
<Project>
<ItemGroup>
<PackageReference Update="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Update="System.Net.Http" Version="4.3.4" />
<PackageReference Update="System.IO.Packaging" Version="4.7.0" />
<PackageReference Update="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Update="System.Composition" Version="1.4.1" />
<PackageReference Update="System.Security.Permissions" Version="4.7.0" />
<PackageReference Update="System.Text.Encoding.CodePages" Version="4.7.1" />
<PackageReference Update="Microsoft.Rest.ClientRuntime" Version="2.3.21" />
<PackageReference Update="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.19" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="3.1.4" />
<PackageReference Update="Microsoft.Azure.Management.ResourceManager" Version="3.7.1-preview" />
<PackageReference Update="Microsoft.Azure.Management.Sql" Version="1.41.0-preview" />
<PackageReference Update="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="1.1.1" />
<PackageReference Update="Microsoft.Data.SqlClient" Version="2.0.0-preview3.20122.2"/>
<PackageReference Update="Microsoft.SqlServer.SqlManagementObjects" Version="160.2004021.0" />
<PackageReference Update="Microsoft.SqlServer.DACFx" Version="150.4787.1-preview" GeneratePathProperty="true" />
<PackageReference Update="Moq" Version="4.8.2" />
<PackageReference Update="NUnit" Version="3.12.0" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.6.1" />
</ItemGroup>
</Project>

View File

@@ -5,8 +5,8 @@ IF [%_BuildConfiguration%] NEQ [] GOTO Start
SET _BuildConfiguration=Debug SET _BuildConfiguration=Debug
:Start :Start
SET _PerfTestSourceLocation="%WORKINGDIR%\test\Microsoft.SqlTools.ServiceLayer.PerfTests\bin\%_BuildConfiguration%\netcoreapp2.2\win7-x64\publish" SET _PerfTestSourceLocation="%WORKINGDIR%\test\Microsoft.SqlTools.ServiceLayer.PerfTests\bin\%_BuildConfiguration%\netcoreapp3.1\win7-x64\publish"
SET _ServiceSourceLocation="%WORKINGDIR%\src\Microsoft.SqlTools.ServiceLayer\bin\%_BuildConfiguration%\netcoreapp2.2\win7-x64\publish" SET _ServiceSourceLocation="%WORKINGDIR%\src\Microsoft.SqlTools.ServiceLayer\bin\%_BuildConfiguration%\netcoreapp3.1\win7-x64\publish"

View File

@@ -91,7 +91,7 @@ steps:
enabled: false enabled: false
- script: | - script: |
copy /Y $(Build.SourcesDirectory)\bin\patch\* $(Build.SourcesDirectory)\artifacts\publish\Microsoft.SqlTools.ServiceLayer\osx.10.11-x64\netcoreapp2.2\ copy /Y $(Build.SourcesDirectory)\bin\patch\* $(Build.SourcesDirectory)\artifacts\publish\Microsoft.SqlTools.ServiceLayer\osx.10.11-x64\netcoreapp3.1\
displayName: 'Copy SqlClient KeepAlive patch to macOS archive' displayName: 'Copy SqlClient KeepAlive patch to macOS archive'
@@ -152,46 +152,46 @@ steps:
- task: ArchiveFiles@1 - task: ArchiveFiles@1
displayName: 'Archive osx build' displayName: 'Archive osx build'
inputs: inputs:
rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/osx.10.11-x64/netcoreapp2.2' rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/osx.10.11-x64/netcoreapp3.1'
includeRootFolder: false includeRootFolder: false
archiveType: tar archiveType: tar
archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.2.tar.gz' archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp3.1.tar.gz'
- task: ArchiveFiles@1 - task: ArchiveFiles@1
displayName: 'Archive rhel build' displayName: 'Archive rhel build'
inputs: inputs:
rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/rhel.7.2-x64/netcoreapp2.2' rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/rhel.7.2-x64/netcoreapp3.1'
includeRootFolder: false includeRootFolder: false
archiveType: tar archiveType: tar
archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-rhel-x64-netcoreapp2.2.tar.gz' archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-rhel-x64-netcoreapp3.1.tar.gz'
- task: ArchiveFiles@1 - task: ArchiveFiles@1
displayName: 'Archive windows 64 bit build' displayName: 'Archive windows 64 bit build'
inputs: inputs:
rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x64/netcoreapp2.2' rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x64/netcoreapp3.1'
includeRootFolder: false includeRootFolder: false
archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.2.zip' archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp3.1.zip'
- task: ArchiveFiles@1 - task: ArchiveFiles@1
displayName: 'Archive windows 32 bit build' displayName: 'Archive windows 32 bit build'
inputs: inputs:
rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x86/netcoreapp2.2' rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x86/netcoreapp3.1'
includeRootFolder: false includeRootFolder: false
archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.2.zip' archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp3.1.zip'
- task: ArchiveFiles@1 - task: ArchiveFiles@1
displayName: 'Archive windows10 arm 32 bit build' displayName: 'Archive windows10 arm 32 bit build'
inputs: inputs:
rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm/netcoreapp2.2' rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm/netcoreapp3.1'
includeRootFolder: false includeRootFolder: false
archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm-netcoreapp2.2.zip' archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm-netcoreapp3.1.zip'
- task: ArchiveFiles@1 - task: ArchiveFiles@1
displayName: 'Archive windows10 arm 64 bit build' displayName: 'Archive windows10 arm 64 bit build'
inputs: inputs:
rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm64/netcoreapp2.2' rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm64/netcoreapp3.1'
includeRootFolder: false includeRootFolder: false
archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm64-netcoreapp2.2.zip' archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm64-netcoreapp3.1.zip'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop' displayName: 'Publish Artifact: drop'

View File

@@ -279,7 +279,7 @@ Task("TestCore")
{ {
var logFile = System.IO.Path.Combine(logFolder, $"{testProject}-core-result.trx"); var logFile = System.IO.Path.Combine(logFolder, $"{testProject}-core-result.trx");
var testWorkingDir = System.IO.Path.Combine(testFolder, testProject); var testWorkingDir = System.IO.Path.Combine(testFolder, testProject);
Run(dotnetcli, $"test -f netcoreapp2.2 --logger \"trx;LogFileName={logFile}\"", testWorkingDir) Run(dotnetcli, $"test --logger \"trx;LogFileName={logFile}\"", testWorkingDir)
.ExceptionOnError($"Test {testProject} failed for .NET Core."); .ExceptionOnError($"Test {testProject} failed for .NET Core.");
} }
}); });
@@ -584,7 +584,7 @@ Task("SRGen")
continue; continue;
} }
var srgenPath = System.IO.Path.Combine(toolsFolder, "Microsoft.Data.Tools.StringResourceTool", "tools", "netcoreapp2.2", "any", "srgen.dll"); var srgenPath = System.IO.Path.Combine(toolsFolder, "Microsoft.Data.Tools.StringResourceTool", "lib", "netcoreapp2.2", "srgen.dll");
var outputResx = System.IO.Path.Combine(localizationDir, "sr.resx"); var outputResx = System.IO.Path.Combine(localizationDir, "sr.resx");
var inputXliff = System.IO.Path.Combine(localizationDir, "transXliff"); var inputXliff = System.IO.Path.Combine(localizationDir, "transXliff");
var outputXlf = System.IO.Path.Combine(localizationDir, "sr.xlf"); var outputXlf = System.IO.Path.Combine(localizationDir, "sr.xlf");

View File

@@ -1,19 +1,19 @@
{ {
"UseSystemDotNetPath": "true", "UseSystemDotNetPath": "true",
"DotNetFolder": ".dotnet", "DotNetFolder": ".dotnet",
"DotNetInstallScriptURL": "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain", "DotNetInstallScriptURL": "https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/",
"DotNetChannel": "preview", "DotNetChannel": "preview",
"DotNetVersion": "2.1.300-preview3-008627", "DotNetVersion": "3.1.202",
"BuildToolsFolder": ".tools", "BuildToolsFolder": ".tools",
"ArtifactsFolder": "artifacts", "ArtifactsFolder": "artifacts",
"PackageName": "Microsoft.SqlTools.ServiceLayer", "PackageName": "Microsoft.SqlTools.ServiceLayer",
"TestProjects": { "TestProjects": {
"Microsoft.SqlTools.ServiceLayer.UnitTests": [ "Microsoft.SqlTools.ServiceLayer.UnitTests": [
"netcoreapp2.2" "netcoreapp3.1"
] ]
}, },
"Frameworks": [ "Frameworks": [
"netcoreapp2.2" "netcoreapp3.1"
], ],
"MainProjects": [ "MainProjects": [
"Microsoft.SqlTools.Credentials", "Microsoft.SqlTools.Credentials",

View File

@@ -1,14 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- <PackageReference Include="Microsoft.SqlServer.Smo" Version="12.0.2000.8" /> --> <PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" />
<!-- <PackageReference Include="System.Data.SqlClient" Version="4.4.0-sqltools-24613-04" /> -->
<PackageReference Include="Microsoft.SqlServer.Smo" Version="140.17279.0-xplat" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\..\..\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj" /> <ProjectReference Include="..\..\..\..\..\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj" />

View File

@@ -1,8 +1,5 @@
{ {
"sdk": { "sdk": {
"version": "2.2.108" "version": "3.1.201"
},
"msbuild-sdks": {
"Microsoft.Build.Traversal": "2.0.2"
} }
} }

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Cake" version="0.30.0" /> <package id="Cake" version="0.37.0" />
<package id="Newtonsoft.Json" version="9.0.1" /> <package id="Newtonsoft.Json" version="12.0.3" />
<package id="Microsoft.Data.Tools.StringResourceTool" version="1.0.0" /> <package id="Microsoft.Data.Tools.StringResourceTool" version="2.0.0" />
<package id="Mono.TextTransform" version="1.0.0" /> <package id="Mono.TextTransform" version="1.0.0" />
<package id="mssql.XliffParser" version="0.5.3" /> <package id="mssql.XliffParser" version="0.5.3" />
<package id="mssql.ResX" version="0.2.0" /> <package id="mssql.ResX" version="0.2.0" />

View File

@@ -8,6 +8,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2BBD7364-054
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{32DC973E-9EEA-4694-B1C2-B031167AB945}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{32DC973E-9EEA-4694-B1C2-B031167AB945}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject

View File

@@ -1,6 +1,27 @@
<Project> <Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup> <PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> <Company>Microsoft Corporation</Company>
<Product>Microsoft SQL Server</Product>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.1.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
<PropertyGroup>
<Authors>Microsoft</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageLicenseUrl>https://github.com/Microsoft/sqltoolsservice/blob/master/license.txt</PackageLicenseUrl>
<PackageIconUrl>http://s.gravatar.com/avatar/6f39d8562df0a3509a8240fb281bc5bd?s=80</PackageIconUrl>
<PackageProjectUrl>https://github.com/Microsoft/sqltoolsservice/</PackageProjectUrl>
<PackageTags>SQL XPLAT</PackageTags>
</PropertyGroup>
<PropertyGroup>
<CredentialsTargetFramework>netcoreapp3.1</CredentialsTargetFramework>
<ServiceLayerTargetFramework>netcoreapp3.1</ServiceLayerTargetFramework>
<ResourceProivderTargetFramework>netcoreapp3.1</ResourceProivderTargetFramework>
</PropertyGroup>
</Project> </Project>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Note you need to build crossplatbuild.proj for xplat projects -->
<PropertyGroup>
<Company>Microsoft Corporation</Company>
<Product>Microsoft SQL Server</Product>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.1.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
<PropertyGroup>
<Authors>Microsoft</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageLicenseUrl>https://github.com/Microsoft/sqltoolsservice/blob/master/license.txt</PackageLicenseUrl>
<PackageIconUrl>http://s.gravatar.com/avatar/6f39d8562df0a3509a8240fb281bc5bd?s=80</PackageIconUrl>
<PackageProjectUrl>https://github.com/Microsoft/sqltoolsservice/</PackageProjectUrl>
<PackageTags>SQL XPLAT</PackageTags>
</PropertyGroup>
</Project>

View File

@@ -1,30 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Microsoft.SqlTools.CoreServices</PackageId> <PackageId>Microsoft.SqlTools.CoreServices</PackageId>
<AssemblyName>Microsoft.SqlTools.CoreServices</AssemblyName> <AssemblyName>Microsoft.SqlTools.CoreServices</AssemblyName>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<ApplicationIcon /> <ApplicationIcon />
<StartupObject /> <StartupObject />
<Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright> <Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright>
<PackageDescription> <PackageDescription>
A collection of core services that can be reused by a Database Management Protocol-based service using the Microsoft.SqlTools.Hosting framework. A collection of core services that can be reused by a Database Management Protocol-based service using the Microsoft.SqlTools.Hosting framework.
</PackageDescription> </PackageDescription>
<Description>$(PackageDescription)</Description> <Description>$(PackageDescription)</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" /> <PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.4" /> <PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <PackageReference Include="System.Text.Encoding.CodePages" />
<PackageReference Include="System.Composition" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.DependencyModel" />
</ItemGroup> <PackageReference Include="System.Runtime.Loader" />
<ItemGroup> <PackageReference Include="System.Composition" />
<ProjectReference Include="..\Microsoft.SqlTools.Hosting.v2\Microsoft.SqlTools.Hosting.v2.csproj" /> </ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.DataProtocol.Contracts\Microsoft.SqlTools.DataProtocol.Contracts.csproj" /> <ItemGroup>
</ItemGroup> <ProjectReference Include="..\Microsoft.SqlTools.Hosting.v2\Microsoft.SqlTools.Hosting.v2.csproj" />
<ItemGroup> <ProjectReference Include="..\Microsoft.SqlTools.DataProtocol.Contracts\Microsoft.SqlTools.DataProtocol.Contracts.csproj" />
<EmbeddedResource Include="Localization\sr.resx" /> </ItemGroup>
<None Include="Localization\sr.strings" /> <ItemGroup>
</ItemGroup> <EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,38 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(CredentialsTargetFramework)</TargetFramework>
<AssemblyName>MicrosoftSqlToolsCredentials</AssemblyName> <AssemblyName>MicrosoftSqlToolsCredentials</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<EnableDefaultItems>false</EnableDefaultItems> <EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<DefineConstants>$(DefineConstants);NETCOREAPP1_0</DefineConstants> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <DefineConstants>$(DefineConstants);NETCOREAPP1_0</DefineConstants>
<PreserveCompilationContext>true</PreserveCompilationContext> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>portable</DebugType> <PreserveCompilationContext>true</PreserveCompilationContext>
<RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;linux-x64;win10-arm;win10-arm64</RuntimeIdentifiers> <DebugType>portable</DebugType>
</PropertyGroup> <RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;linux-x64;win10-arm;win10-arm64</RuntimeIdentifiers>
<ItemGroup> </PropertyGroup>
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftPackageVersion)" /> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" /> <Compile Include="**\*.cs" Exclude="**/obj/**/*.cs" />
<PackageReference Include="System.IO.Packaging" Version="4.5.0" /> </ItemGroup>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <ItemGroup>
<PackageReference Include="System.Composition" Version="1.1.0" /> <PackageReference Include="Newtonsoft.Json"/>
<PackageReference Include="System.Security.Permissions" Version="4.5.0" /> <PackageReference Include="Microsoft.Extensions.DependencyModel" />
<PackageReference Include="System.IO.Packaging" />
<!-- delete reference from project once moving off preview version !--> <PackageReference Include="System.Runtime.Loader" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" /> <PackageReference Include="System.Composition" />
</ItemGroup> <PackageReference Include="System.Security.Permissions" />
<ItemGroup> <PackageReference Include="System.Text.Encoding.CodePages"/>
<Compile Include="**\*.cs" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> </ItemGroup>
</ItemGroup> <ItemGroup>
<ItemGroup> <EmbeddedResource Include="Localization\sr.resx" />
<EmbeddedResource Include="Localization\sr.resx" /> <None Include="Localization\sr.strings" />
<None Include="Localization\sr.strings" /> </ItemGroup>
</ItemGroup>
</Project> </Project>

View File

@@ -10,6 +10,6 @@
<ProjectReference Include="..\Microsoft.SqlTools.Hosting.Contracts\Microsoft.SqlTools.Hosting.Contracts.csproj" /> <ProjectReference Include="..\Microsoft.SqlTools.Hosting.Contracts\Microsoft.SqlTools.Hosting.Contracts.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftPackageVersion)" /> <PackageReference Include="Newtonsoft.Json" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -15,10 +15,10 @@
<Description>$(PackageDescription)</Description> <Description>$(PackageDescription)</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.4" /> <PackageReference Include="Microsoft.Extensions.DependencyModel" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftPackageVersion)" /> <PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.Composition" Version="1.1.0" /> <PackageReference Include="System.Composition"/>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <PackageReference Include="System.Runtime.Loader" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Localization\transXliff" /> <Folder Include="Localization\transXliff" />

View File

@@ -1,30 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems> <EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants> <DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftPackageVersion)" /> <Compile Include="**\*.cs" Exclude="**/obj/**/*.cs" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" /> </ItemGroup>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <ItemGroup>
<PackageReference Include="System.Composition" Version="1.1.0" /> <PackageReference Include="Newtonsoft.Json" />
</ItemGroup> <PackageReference Include="Microsoft.Extensions.DependencyModel" />
<ItemGroup> <PackageReference Include="System.Runtime.Loader" />
<Compile Include="**\*.cs" /> <PackageReference Include="System.Composition" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Localization\sr.resx" /> <EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" /> <None Include="Localization\sr.strings" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,18 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Localization\transXliff\" /> <Folder Include="Localization\transXliff\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Localization\sr.resx" /> <PackageReference Include="Microsoft.Data.SqlClient" />
<None Include="Localization\sr.strings" /> <PackageReference Include="Microsoft.SqlServer.DACFx" />
</ItemGroup> <PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" />
<ItemGroup> </ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" /> <ItemGroup>
</ItemGroup> <EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,25 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Microsoft.SqlTools.ResourceProvider.Core</PackageId> <PackageId>Microsoft.SqlTools.ResourceProvider.Core</PackageId>
<AssemblyName>Microsoft.SqlTools.ResourceProvider.Core</AssemblyName> <AssemblyName>Microsoft.SqlTools.ResourceProvider.Core</AssemblyName>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<ApplicationIcon /> <ApplicationIcon />
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<StartupObject /> <StartupObject />
<Description>Provides Resource Provider and control plane services for SqlTools applications.</Description> <Description>Provides Resource Provider and control plane services for SqlTools applications.</Description>
<Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright> <Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" /> <PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <PackageReference Include="Microsoft.Extensions.DependencyModel"/>
<PackageReference Include="System.Composition" Version="1.1.0" /> <PackageReference Include="System.Runtime.Loader"/>
</ItemGroup> <PackageReference Include="System.Composition"/>
<ItemGroup> </ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" /> <ItemGroup>
</ItemGroup> <ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" />
<ItemGroup> </ItemGroup>
<EmbeddedResource Include="Localization\sr.resx" /> <ItemGroup>
<None Include="Localization\sr.strings" /> <EmbeddedResource Include="Localization\sr.resx" />
</ItemGroup> <None Include="Localization\sr.strings" />
</ItemGroup>
</Project> </Project>

View File

@@ -11,13 +11,13 @@
<Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright> <Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" /> <PackageReference Include="Microsoft.Azure.Management.ResourceManager" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" /> <PackageReference Include="Microsoft.Rest.ClientRuntime" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.10" /> <PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyModel" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <PackageReference Include="System.Runtime.Loader" />
<PackageReference Include="System.Composition" Version="1.1.0" /> <PackageReference Include="System.Composition"/>
<PackageReference Include="Microsoft.Azure.Management.Sql" Version="1.7.0-preview" /> <PackageReference Include="Microsoft.Azure.Management.Sql"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj" /> <ProjectReference Include="..\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(ResourceProivderTargetFramework)</TargetFramework>
<PackageId>SqlToolsResourceProviderService</PackageId> <PackageId>SqlToolsResourceProviderService</PackageId>
<AssemblyName>SqlToolsResourceProviderService</AssemblyName> <AssemblyName>SqlToolsResourceProviderService</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
@@ -19,8 +19,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- delete reference from project once moving off preview version !--> <PackageReference Include="System.Text.Encoding.CodePages"/>
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" /> <ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" />

View File

@@ -20,6 +20,7 @@ using Microsoft.SqlTools.ServiceLayer.SqlContext;
using Microsoft.SqlTools.ServiceLayer.Workspace; using Microsoft.SqlTools.ServiceLayer.Workspace;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Microsoft.SqlTools.Utility; using Microsoft.SqlTools.Utility;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.Formatter namespace Microsoft.SqlTools.ServiceLayer.Formatter
{ {

View File

@@ -1,35 +1,36 @@
// //
// Copyright (c) Microsoft. All rights reserved. // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using Microsoft.SqlServer.Management.SqlParser.Binder; using Microsoft.SqlServer.Management.SqlParser.Binder;
using Microsoft.SqlServer.Management.SqlParser.Intellisense; using Microsoft.SqlServer.Management.SqlParser.Intellisense;
using Microsoft.SqlServer.Management.SqlParser.Parser; using Microsoft.SqlServer.Management.SqlParser.Parser;
using Microsoft.SqlTools.ServiceLayer.Connection; using Microsoft.SqlTools.ServiceLayer.Connection;
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion; using Microsoft.SqlTools.ServiceLayer.LanguageServices.Completion;
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts; using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts;
using Microsoft.SqlTools.ServiceLayer.SqlContext; using Microsoft.SqlTools.ServiceLayer.SqlContext;
using Microsoft.SqlTools.Utility; using Microsoft.SqlTools.Utility;
using Microsoft.SqlTools.ServiceLayer.Workspace; using Microsoft.SqlTools.ServiceLayer.Workspace;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
{ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
/// <summary> {
/// Main class for Language Service functionality including anything that reqires knowledge of /// <summary>
/// the language to perfom, such as definitions, intellisense, etc. /// Main class for Language Service functionality including anything that reqires knowledge of
/// </summary> /// the language to perfom, such as definitions, intellisense, etc.
public static class AutoCompleteHelper /// </summary>
{ public static class AutoCompleteHelper
private static CompletionItem[] emptyCompletionList = new CompletionItem[0]; {
private static CompletionItem[] emptyCompletionList = new CompletionItem[0];
public static readonly string[] DefaultCompletionText = new string[]
{ public static readonly string[] DefaultCompletionText = new string[]
{
"abs", "abs",
"acos", "acos",
"action", "action",
@@ -469,263 +470,263 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
"xml", "xml",
"year", "year",
"zone", "zone",
}; };
/// <summary> /// <summary>
/// Gets a static instance of an empty completion list to avoid /// Gets a static instance of an empty completion list to avoid
/// unneeded memory allocations /// unneeded memory allocations
/// </summary> /// </summary>
internal static CompletionItem[] EmptyCompletionList internal static CompletionItem[] EmptyCompletionList
{ {
get get
{ {
return AutoCompleteHelper.emptyCompletionList; return AutoCompleteHelper.emptyCompletionList;
} }
} }
/// <summary> /// <summary>
/// Checks whether a given word is in the reserved /// Checks whether a given word is in the reserved
/// word list or not /// word list or not
/// </summary> /// </summary>
internal static bool IsReservedWord(string text) internal static bool IsReservedWord(string text)
{ {
return DefaultCompletionText.Contains(text, StringComparer.InvariantCultureIgnoreCase); return DefaultCompletionText.Contains(text, StringComparer.InvariantCultureIgnoreCase);
} }
/// <summary> /// <summary>
/// Get the default completion list from hard-coded list /// Get the default completion list from hard-coded list
/// </summary> /// </summary>
/// <param name="row"></param> /// <param name="row"></param>
/// <param name="startColumn"></param> /// <param name="startColumn"></param>
/// <param name="endColumn"></param> /// <param name="endColumn"></param>
/// <param name="useLowerCase"></param> /// <param name="useLowerCase"></param>
internal static CompletionItem[] GetDefaultCompletionItems( internal static CompletionItem[] GetDefaultCompletionItems(
ScriptDocumentInfo scriptDocumentInfo, ScriptDocumentInfo scriptDocumentInfo,
bool useLowerCase) bool useLowerCase)
{ {
int row = scriptDocumentInfo.StartLine; int row = scriptDocumentInfo.StartLine;
int startColumn = scriptDocumentInfo.StartColumn; int startColumn = scriptDocumentInfo.StartColumn;
int endColumn = scriptDocumentInfo.EndColumn; int endColumn = scriptDocumentInfo.EndColumn;
string tokenText = scriptDocumentInfo.TokenText; string tokenText = scriptDocumentInfo.TokenText;
// determine how many default completion items there will be // determine how many default completion items there will be
int listSize = DefaultCompletionText.Length; int listSize = DefaultCompletionText.Length;
if (!string.IsNullOrWhiteSpace(tokenText)) if (!string.IsNullOrWhiteSpace(tokenText))
{ {
listSize = 0; listSize = 0;
foreach (var completionText in DefaultCompletionText) foreach (var completionText in DefaultCompletionText)
{ {
if (completionText.StartsWith(tokenText, StringComparison.OrdinalIgnoreCase)) if (completionText.StartsWith(tokenText, StringComparison.OrdinalIgnoreCase))
{ {
++listSize; ++listSize;
} }
} }
} }
// special case empty list to avoid unneed array allocations // special case empty list to avoid unneed array allocations
if (listSize == 0) if (listSize == 0)
{ {
return emptyCompletionList; return emptyCompletionList;
} }
// build the default completion list // build the default completion list
var completionItems = new CompletionItem[listSize]; var completionItems = new CompletionItem[listSize];
int completionItemIndex = 0; int completionItemIndex = 0;
foreach (var completionText in DefaultCompletionText) foreach (var completionText in DefaultCompletionText)
{ {
// add item to list if the tokenText is null (meaning return whole list) // add item to list if the tokenText is null (meaning return whole list)
// or if the completion item begins with the tokenText // or if the completion item begins with the tokenText
if (string.IsNullOrWhiteSpace(tokenText) || completionText.StartsWith(tokenText, StringComparison.OrdinalIgnoreCase)) if (string.IsNullOrWhiteSpace(tokenText) || completionText.StartsWith(tokenText, StringComparison.OrdinalIgnoreCase))
{ {
completionItems[completionItemIndex] = CreateDefaultCompletionItem( completionItems[completionItemIndex] = CreateDefaultCompletionItem(
useLowerCase ? completionText.ToLowerInvariant() : completionText.ToUpperInvariant(), useLowerCase ? completionText.ToLowerInvariant() : completionText.ToUpperInvariant(),
row, row,
startColumn, startColumn,
endColumn); endColumn);
++completionItemIndex; ++completionItemIndex;
} }
} }
return completionItems; return completionItems;
} }
/// <summary> /// <summary>
/// Create a completion item from the default item text /// Create a completion item from the default item text
/// </summary> /// </summary>
/// <param name="label"></param> /// <param name="label"></param>
/// <param name="row"></param> /// <param name="row"></param>
/// <param name="startColumn"></param> /// <param name="startColumn"></param>
/// <param name="endColumn"></param> /// <param name="endColumn"></param>
private static CompletionItem CreateDefaultCompletionItem( private static CompletionItem CreateDefaultCompletionItem(
string label, string label,
int row, int row,
int startColumn, int startColumn,
int endColumn) int endColumn)
{ {
return SqlCompletionItem.CreateCompletionItem(label, label + " keyword", label, CompletionItemKind.Keyword, row, startColumn, endColumn); return SqlCompletionItem.CreateCompletionItem(label, label + " keyword", label, CompletionItemKind.Keyword, row, startColumn, endColumn);
} }
internal static CompletionItem[] AddTokenToItems(CompletionItem[] currentList, Token token, int row, internal static CompletionItem[] AddTokenToItems(CompletionItem[] currentList, Token token, int row,
int startColumn, int startColumn,
int endColumn) int endColumn)
{ {
if (currentList != null && if (currentList != null &&
token != null && !string.IsNullOrWhiteSpace(token.Text) && token != null && !string.IsNullOrWhiteSpace(token.Text) &&
token.Text.All(ch => char.IsLetter(ch)) && token.Text.All(ch => char.IsLetter(ch)) &&
currentList.All(x => string.Compare(x.Label, token.Text, true) != 0 currentList.All(x => string.Compare(x.Label, token.Text, true) != 0
)) ))
{ {
var list = currentList.ToList(); var list = currentList.ToList();
list.Insert(0, SqlCompletionItem.CreateCompletionItem(token.Text, token.Text, token.Text, CompletionItemKind.Text, row, startColumn, endColumn)); list.Insert(0, SqlCompletionItem.CreateCompletionItem(token.Text, token.Text, token.Text, CompletionItemKind.Text, row, startColumn, endColumn));
return list.ToArray(); return list.ToArray();
} }
return currentList; return currentList;
} }
/// <summary> /// <summary>
/// Converts a list of Declaration objects to CompletionItem objects /// Converts a list of Declaration objects to CompletionItem objects
/// since VS Code expects CompletionItems but SQL Parser works with Declarations /// since VS Code expects CompletionItems but SQL Parser works with Declarations
/// </summary> /// </summary>
/// <param name="suggestions"></param> /// <param name="suggestions"></param>
/// <param name="cursorRow"></param> /// <param name="cursorRow"></param>
/// <param name="cursorColumn"></param> /// <param name="cursorColumn"></param>
/// <returns></returns> /// <returns></returns>
internal static CompletionItem[] ConvertDeclarationsToCompletionItems( internal static CompletionItem[] ConvertDeclarationsToCompletionItems(
IEnumerable<Declaration> suggestions, IEnumerable<Declaration> suggestions,
int row, int row,
int startColumn, int startColumn,
int endColumn, int endColumn,
string tokenText = null) string tokenText = null)
{ {
List<CompletionItem> completions = new List<CompletionItem>(); List<CompletionItem> completions = new List<CompletionItem>();
foreach (var autoCompleteItem in suggestions) foreach (var autoCompleteItem in suggestions)
{ {
SqlCompletionItem sqlCompletionItem = new SqlCompletionItem(autoCompleteItem, tokenText); SqlCompletionItem sqlCompletionItem = new SqlCompletionItem(autoCompleteItem, tokenText);
// convert the completion item candidates into CompletionItems // convert the completion item candidates into CompletionItems
completions.Add(sqlCompletionItem.CreateCompletionItem(row, startColumn, endColumn)); completions.Add(sqlCompletionItem.CreateCompletionItem(row, startColumn, endColumn));
} }
return completions.ToArray(); return completions.ToArray();
} }
/// <summary> /// <summary>
/// Converts a SQL Parser QuickInfo object into a VS Code Hover object /// Converts a SQL Parser QuickInfo object into a VS Code Hover object
/// </summary> /// </summary>
/// <param name="quickInfo"></param> /// <param name="quickInfo"></param>
/// <param name="row"></param> /// <param name="row"></param>
/// <param name="startColumn"></param> /// <param name="startColumn"></param>
/// <param name="endColumn"></param> /// <param name="endColumn"></param>
internal static Hover ConvertQuickInfoToHover( internal static Hover ConvertQuickInfoToHover(
Babel.CodeObjectQuickInfo quickInfo, Babel.CodeObjectQuickInfo quickInfo,
int row, int row,
int startColumn, int startColumn,
int endColumn) int endColumn)
{ {
// convert from the parser format to the VS Code wire format // convert from the parser format to the VS Code wire format
var markedStrings = new MarkedString[1]; var markedStrings = new MarkedString[1];
if (quickInfo != null) if (quickInfo != null)
{ {
markedStrings[0] = new MarkedString() markedStrings[0] = new MarkedString()
{ {
Language = "SQL", Language = "SQL",
Value = quickInfo.Text Value = quickInfo.Text
}; };
return new Hover() return new Hover()
{ {
Contents = markedStrings, Contents = markedStrings,
Range = new Range Range = new Range
{ {
Start = new Position Start = new Position
{ {
Line = row, Line = row,
Character = startColumn Character = startColumn
}, },
End = new Position End = new Position
{ {
Line = row, Line = row,
Character = endColumn Character = endColumn
} }
} }
}; };
} }
else else
{ {
return null; return null;
} }
} }
/// <summary> /// <summary>
/// Converts a SQL Parser List of MethodHelpText objects into a VS Code SignatureHelp object /// Converts a SQL Parser List of MethodHelpText objects into a VS Code SignatureHelp object
/// </summary> /// </summary>
internal static SignatureHelp ConvertMethodHelpTextListToSignatureHelp(List<Babel.MethodHelpText> methods, Babel.MethodNameAndParamLocations locations, int line, int column) internal static SignatureHelp ConvertMethodHelpTextListToSignatureHelp(List<Babel.MethodHelpText> methods, Babel.MethodNameAndParamLocations locations, int line, int column)
{ {
Validate.IsNotNull(nameof(methods), methods); Validate.IsNotNull(nameof(methods), methods);
Validate.IsNotNull(nameof(locations), locations); Validate.IsNotNull(nameof(locations), locations);
Validate.IsGreaterThan(nameof(line), line, 0); Validate.IsGreaterThan(nameof(line), line, 0);
Validate.IsGreaterThan(nameof(column), column, 0); Validate.IsGreaterThan(nameof(column), column, 0);
SignatureHelp help = new SignatureHelp(); SignatureHelp help = new SignatureHelp();
help.Signatures = methods.Select(method => help.Signatures = methods.Select(method =>
{ {
return new SignatureInformation() return new SignatureInformation()
{ {
// Signature label format: <name> param1, param2, ..., paramn RETURNS <type> // Signature label format: <name> param1, param2, ..., paramn RETURNS <type>
Label = method.Name + " " + method.Parameters.Select(parameter => parameter.Display).Aggregate((l, r) => l + "," + r) + " " + method.Type, Label = method.Name + " " + method.Parameters.Select(parameter => parameter.Display).Aggregate((l, r) => l + "," + r) + " " + method.Type,
Documentation = method.Description, Documentation = method.Description,
Parameters = method.Parameters.Select(parameter => Parameters = method.Parameters.Select(parameter =>
{ {
return new ParameterInformation() return new ParameterInformation()
{ {
Label = parameter.Display, Label = parameter.Display,
Documentation = parameter.Description Documentation = parameter.Description
}; };
}).ToArray() }).ToArray()
}; };
}).Where(method => method.Label.Contains(locations.Name)).ToArray(); }).Where(method => method.Label.Contains(locations.Name)).ToArray();
if (help.Signatures.Length == 0) if (help.Signatures.Length == 0)
{ {
return null; return null;
} }
// Find the matching method signature at the cursor's location // Find the matching method signature at the cursor's location
// For now, take the first match (since we've already filtered by name above) // For now, take the first match (since we've already filtered by name above)
help.ActiveSignature = 0; help.ActiveSignature = 0;
// Determine the current parameter at the cursor // Determine the current parameter at the cursor
int currentParameter = -1; // Default case: not on any particular parameter int currentParameter = -1; // Default case: not on any particular parameter
if (locations.ParamStartLocation != null) if (locations.ParamStartLocation != null)
{ {
// Is the cursor past the function name? // Is the cursor past the function name?
var location = locations.ParamStartLocation.Value; var location = locations.ParamStartLocation.Value;
if (line > location.LineNumber || (line == location.LineNumber && line == location.LineNumber && column >= location.ColumnNumber)) if (line > location.LineNumber || (line == location.LineNumber && line == location.LineNumber && column >= location.ColumnNumber))
{ {
currentParameter = 0; currentParameter = 0;
} }
} }
foreach (var location in locations.ParamSeperatorLocations) foreach (var location in locations.ParamSeperatorLocations)
{ {
// Is the cursor past a comma ',' and at least on the next parameter? // Is the cursor past a comma ',' and at least on the next parameter?
if (line > location.LineNumber || (line == location.LineNumber && column > location.ColumnNumber)) if (line > location.LineNumber || (line == location.LineNumber && column > location.ColumnNumber))
{ {
currentParameter++; currentParameter++;
} }
} }
if (locations.ParamEndLocation != null) if (locations.ParamEndLocation != null)
{ {
// Is the cursor past the end of the parameter list on a different token? // Is the cursor past the end of the parameter list on a different token?
var location = locations.ParamEndLocation.Value; var location = locations.ParamEndLocation.Value;
if (line > location.LineNumber || (line == location.LineNumber && line == location.LineNumber && column > location.ColumnNumber)) if (line > location.LineNumber || (line == location.LineNumber && line == location.LineNumber && column > location.ColumnNumber))
{ {
currentParameter = -1; currentParameter = -1;
} }
} }
help.ActiveParameter = currentParameter; help.ActiveParameter = currentParameter;
return help; return help;
} }
} }
} }

View File

@@ -11,6 +11,7 @@ using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts; using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Microsoft.SqlTools.Utility; using Microsoft.SqlTools.Utility;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.LanguageServices namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
{ {

View File

@@ -1,45 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(ServiceLayerTargetFramework)</TargetFramework>
<AssemblyName>MicrosoftSqlToolsServiceLayer</AssemblyName> <AssemblyName>MicrosoftSqlToolsServiceLayer</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<EnableDefaultItems>false</EnableDefaultItems> <EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants>
<PreserveCompilationContext>true</PreserveCompilationContext> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>portable</DebugType> <PreserveCompilationContext>true</PreserveCompilationContext>
<RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;linux-x64;win10-arm;win10-arm64</RuntimeIdentifiers> <DebugType>portable</DebugType>
</PropertyGroup> <RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;linux-x64;win10-arm;win10-arm64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="1.0.0" /> <PackageReference Include="Microsoft.SqlServer.DACFx" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" /> <PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" />
</ItemGroup> <PackageReference Include="System.Text.Encoding.CodePages" />
<ItemGroup> </ItemGroup>
<Compile Include="**\*.cs" />
</ItemGroup> <ItemGroup>
<ItemGroup> <Compile Include="**\*.cs" Exclude="**/obj/**/*.cs" />
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> </ItemGroup>
<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" /> <ItemGroup>
</ItemGroup> <ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ItemGroup> <ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<Content Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\netstandard2.0\Microsoft.Data.Tools.Schema.SqlTasks.targets"> <ProjectReference Include="../Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
<CopyToPublishDirectory>Always</CopyToPublishDirectory> </ItemGroup>
</Content> <ItemGroup>
<EmbeddedResource Include="ObjectExplorer\SmoModel\TreeNodeDefinition.xml" /> <Content Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\netstandard2.0\Microsoft.Data.Tools.Schema.SqlTasks.targets">
<EmbeddedResource Include="Localization\sr.resx" /> <CopyToPublishDirectory>Always</CopyToPublishDirectory>
<None Include="Localization\sr.strings" /> </Content>
</ItemGroup> <EmbeddedResource Include="ObjectExplorer\SmoModel\TreeNodeDefinition.xml" />
<ItemGroup> <EmbeddedResource Include="Localization\sr.resx" />
<EmbeddedResource Include=".\Agent\NotebookResources\NotebookJobScript.ps1" /> <None Include="Localization\sr.strings" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include=".\Agent\NotebookResources\NotebookJobScript.ps1" />
</ItemGroup>
</Project> </Project>

View File

@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
using Index = Microsoft.SqlServer.Management.Smo.Index;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{ {

View File

@@ -8,6 +8,7 @@ using System.Composition;
using System.Linq; using System.Linq;
using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Broker; using Microsoft.SqlServer.Management.Smo.Broker;
using Index = Microsoft.SqlServer.Management.Smo.Index;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{ {

View File

@@ -17,6 +17,7 @@ using System.Composition;
using System.Linq; using System.Linq;
using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Broker; using Microsoft.SqlServer.Management.Smo.Broker;
using Index = Microsoft.SqlServer.Management.Smo.Index;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{ {

View File

@@ -26,6 +26,7 @@ using Microsoft.SqlServer.Management.Sdk.Sfc;
using System.Text; using System.Text;
using System.Data; using System.Data;
using System.Diagnostics; using System.Diagnostics;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.Scripting namespace Microsoft.SqlTools.ServiceLayer.Scripting
{ {

View File

@@ -13,6 +13,7 @@ using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.Hosting; using Microsoft.SqlTools.ServiceLayer.Hosting;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Microsoft.SqlTools.Utility; using Microsoft.SqlTools.Utility;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.Workspace namespace Microsoft.SqlTools.ServiceLayer.Workspace
{ {

View File

@@ -1,6 +1,7 @@
<Project> <Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> <PropertyGroup>
</PropertyGroup> <TestProjectsTargetFramework>netcoreapp3.1</TestProjectsTargetFramework>
</PropertyGroup>
</Project> </Project>

View File

@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" Version="4.8.2" /> <PackageReference Include="Moq"/>
<PackageReference Include="xunit" Version="2.3.1" /> <PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.SqlTools.DataProtocol.Contracts\Microsoft.SqlTools.DataProtocol.Contracts.csproj" /> <ProjectReference Include="..\..\src\Microsoft.SqlTools.DataProtocol.Contracts\Microsoft.SqlTools.DataProtocol.Contracts.csproj" />

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="xunit.methodDisplay" value="method" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
<AssemblyName>Microsoft.SqlTools.ManagedBatchParser.IntegrationTests</AssemblyName> <AssemblyName>Microsoft.SqlTools.ManagedBatchParser.IntegrationTests</AssemblyName>
@@ -9,18 +9,6 @@
<DefineConstants>$(DefineConstants);TRACE</DefineConstants> <DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>../../bin/ref/Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>../../bin/ref/Moq.dll</HintPath>
</Reference>
<Reference Include="Castle.Core">
<HintPath>../../bin/ref/Castle.Core.dll</HintPath>
</Reference>
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" /> <ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
@@ -28,10 +16,11 @@
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj" /> <ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Net.Http" Version="4.3.4" /> <PackageReference Include="System.Net.Http"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="Moq" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net461" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
</packages>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="xunit.methodDisplay" value="method"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>

View File

@@ -203,10 +203,10 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Metadata
} }
}; };
await VerifyMetadataList(query, expectedMetadataList); await VerifyMetadataListCore(query, expectedMetadataList);
} }
private async Task VerifyMetadataList(string query, List<ObjectMetadata> expectedMetadataList) private async Task VerifyMetadataListCore(string query, List<ObjectMetadata> expectedMetadataList)
{ {
var testDb = await SqlTestDb.CreateNewAsync(TestServerType.OnPrem, false, null, query, "MetadataTests"); var testDb = await SqlTestDb.CreateNewAsync(TestServerType.OnPrem, false, null, query, "MetadataTests");
try try

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
<AssemblyName>Microsoft.SqlTools.ServiceLayer.IntegrationTests</AssemblyName> <AssemblyName>Microsoft.SqlTools.ServiceLayer.IntegrationTests</AssemblyName>
@@ -9,18 +9,6 @@
<DefineConstants>$(DefineConstants);TRACE</DefineConstants> <DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>../../bin/ref/Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>../../bin/ref/Moq.dll</HintPath>
</Reference>
<Reference Include="Castle.Core">
<HintPath>../../bin/ref/Castle.Core.dll</HintPath>
</Reference>
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" /> <ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
@@ -29,10 +17,11 @@
<ProjectReference Include="../Microsoft.SqlTools.Test.CompletionExtension/Microsoft.SqlTools.Test.CompletionExtension.csproj" /> <ProjectReference Include="../Microsoft.SqlTools.Test.CompletionExtension/Microsoft.SqlTools.Test.CompletionExtension.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Net.Http" Version="4.3.4" /> <PackageReference Include="Moq" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="System.Net.Http"/>
<PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net461" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
</packages>

View File

@@ -1,40 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
<AssemblyName>Microsoft.SqlTools.ServiceLayer.PerfTests</AssemblyName> <AssemblyName>Microsoft.SqlTools.ServiceLayer.PerfTests</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers> <RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
<StartupObject>Microsoft.SqlTools.ServiceLayer.PerfTests.Program</StartupObject> <StartupObject>Microsoft.SqlTools.ServiceLayer.PerfTests.Program</StartupObject>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json"> <ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" />
<HintPath>../../bin/ref/Newtonsoft.Json.dll</HintPath> <ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
</Reference> <ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<Reference Include="Moq"> <ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.TestDriver/Microsoft.SqlTools.ServiceLayer.TestDriver.csproj" />
<HintPath>../../bin/ref/Moq.dll</HintPath> <ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
</Reference> </ItemGroup>
<Reference Include="Castle.Core"> <ItemGroup>
<HintPath>../../bin/ref/Castle.Core.dll</HintPath> <PackageReference Include="Moq" />
</Reference> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" /> <PackageReference Include="xunit" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> <PackageReference Include="xunit.runner.visualstudio" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" /> </ItemGroup>
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.TestDriver/Microsoft.SqlTools.ServiceLayer.TestDriver.csproj" /> <ItemGroup>
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<ItemGroup> </ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project> </Project>

View File

@@ -12,6 +12,7 @@ using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts;
using Microsoft.SqlTools.ServiceLayer.Test.Common; using Microsoft.SqlTools.ServiceLayer.Test.Common;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Xunit; using Xunit;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.PerfTests namespace Microsoft.SqlTools.ServiceLayer.PerfTests
{ {

View File

@@ -18,49 +18,49 @@ namespace Microsoft.SqlTools.ServiceLayer.PerfTests
[Fact] [Fact]
public async Task QueryResultSummaryOnPremTest() public async Task QueryResultSummaryOnPremTest()
{ {
await QueryResultSummaryOnPremTest(TestServerType.OnPrem, Scripts.MasterBasicQuery); await QueryResultSummaryOnPremTestCore(TestServerType.OnPrem, Scripts.MasterBasicQuery);
} }
[Fact] [Fact]
public async Task QueryResultFirstOnPremTest() public async Task QueryResultFirstOnPremTest()
{ {
await QueryResultFirstOnPremTest(TestServerType.OnPrem, Scripts.MasterBasicQuery); await QueryResultFirstOnPremTestCore(TestServerType.OnPrem, Scripts.MasterBasicQuery);
} }
[Fact] [Fact]
public async Task LongQueryResultSummaryOnPremTest() public async Task LongQueryResultSummaryOnPremTest()
{ {
await QueryResultSummaryOnPremTest(TestServerType.OnPrem, Scripts.MasterLongQuery); await QueryResultSummaryOnPremTestCore(TestServerType.OnPrem, Scripts.MasterLongQuery);
} }
[Fact] [Fact]
public async Task LongQueryResultFirstOnPremTest() public async Task LongQueryResultFirstOnPremTest()
{ {
await QueryResultFirstOnPremTest(TestServerType.OnPrem, Scripts.MasterLongQuery); await QueryResultFirstOnPremTestCore(TestServerType.OnPrem, Scripts.MasterLongQuery);
} }
[Fact] [Fact]
public async Task QueryResultSummaryOnAzureTest() public async Task QueryResultSummaryOnAzureTest()
{ {
await QueryResultSummaryOnPremTest(TestServerType.Azure, Scripts.MasterBasicQuery); await QueryResultSummaryOnPremTestCore(TestServerType.Azure, Scripts.MasterBasicQuery);
} }
[Fact] [Fact]
public async Task QueryResultFirstOnAzureTest() public async Task QueryResultFirstOnAzureTest()
{ {
await QueryResultFirstOnPremTest(TestServerType.Azure, Scripts.MasterBasicQuery); await QueryResultFirstOnPremTestCore(TestServerType.Azure, Scripts.MasterBasicQuery);
} }
[Fact] [Fact]
public async Task LongQueryResultSummaryOnAzureTest() public async Task LongQueryResultSummaryOnAzureTest()
{ {
await QueryResultSummaryOnPremTest(TestServerType.Azure, Scripts.MasterLongQuery); await QueryResultSummaryOnPremTestCore(TestServerType.Azure, Scripts.MasterLongQuery);
} }
[Fact] [Fact]
public async Task LongQueryResultFirstOnAzureTest() public async Task LongQueryResultFirstOnAzureTest()
{ {
await QueryResultFirstOnPremTest(TestServerType.Azure, Scripts.MasterLongQuery); await QueryResultFirstOnPremTestCore(TestServerType.Azure, Scripts.MasterLongQuery);
} }
[Fact] [Fact]
@@ -103,7 +103,7 @@ namespace Microsoft.SqlTools.ServiceLayer.PerfTests
} }
private async Task QueryResultSummaryOnPremTest(TestServerType serverType, string query, [CallerMemberName] string testName = "") private async Task QueryResultSummaryOnPremTestCore(TestServerType serverType, string query, [CallerMemberName] string testName = "")
{ {
await TestServiceDriverProvider.RunTestIterations(async (timer) => await TestServiceDriverProvider.RunTestIterations(async (timer) =>
{ {
@@ -124,7 +124,7 @@ namespace Microsoft.SqlTools.ServiceLayer.PerfTests
}, testName); }, testName);
} }
private async Task QueryResultFirstOnPremTest(TestServerType serverType, string query, [CallerMemberName] string testName = "") private async Task QueryResultFirstOnPremTestCore(TestServerType serverType, string query, [CallerMemberName] string testName = "")
{ {
await TestServiceDriverProvider.RunTestIterations(async (timer) => await TestServiceDriverProvider.RunTestIterations(async (timer) =>
{ {

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -8,9 +8,10 @@
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="Moq" />
<PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Scripts/CreateTestDatabaseObjects.sql" /> <EmbeddedResource Include="Scripts/CreateTestDatabaseObjects.sql" />
@@ -20,12 +21,6 @@
<EmbeddedResource Include="Scripts/TestDbTableQueries.sql" /> <EmbeddedResource Include="Scripts/TestDbTableQueries.sql" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Moq">
<HintPath>..\..\bin\ref\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\bin\ref\Newtonsoft.Json.dll</HintPath>
</Reference>
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
<AssemblyName>Microsoft.SqlTools.ServiceLayer.TestDriver.Tests</AssemblyName> <AssemblyName>Microsoft.SqlTools.ServiceLayer.TestDriver.Tests</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
@@ -20,9 +20,9 @@
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" /> <ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />

View File

@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using Microsoft.SqlTools.ServiceLayer.Test.Common; using Microsoft.SqlTools.ServiceLayer.Test.Common;
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
using Xunit; using Xunit;
using Range = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Range;
namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
{ {

View File

@@ -51,7 +51,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
{ {
// Include a fallback value to for running tests within visual studio // Include a fallback value to for running tests within visual studio
serviceHostExecutable = serviceHostExecutable =
@"..\..\..\..\..\src\Microsoft.SqlTools.ServiceLayer\bin\Debug\netcoreapp2.2\win7-x64\MicrosoftSqlToolsServiceLayer.exe"; @"..\..\..\..\..\src\Microsoft.SqlTools.ServiceLayer\bin\Debug\netcoreapp3.1\win7-x64\MicrosoftSqlToolsServiceLayer.exe";
} }
serviceHostExecutable = Path.GetFullPath(serviceHostExecutable); serviceHostExecutable = Path.GetFullPath(serviceHostExecutable);

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems> <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -8,9 +8,9 @@
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> <ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<AssemblyName>Microsoft.SqlTools.ServiceLayer.TestEnvConfig</AssemblyName> <AssemblyName>Microsoft.SqlTools.ServiceLayer.TestEnvConfig</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="xunit.methodDisplay" value="method"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>

View File

@@ -95,7 +95,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.Equal(col, cu.Column); Assert.Equal(col, cu.Column);
} }
public static IEnumerable<object> ByteArrayTestParams public static IEnumerable<object[]> ByteArrayTestParams
{ {
get get
{ {
@@ -158,7 +158,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.Equal(col, cu.Column); Assert.Equal(col, cu.Column);
} }
public static IEnumerable<object> BoolTestParams public static IEnumerable<object[]> BoolTestParams
{ {
get get
{ {
@@ -206,7 +206,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.Equal(col, cu.Column); Assert.Equal(col, cu.Column);
} }
public static IEnumerable<object> RoundTripTestParams public static IEnumerable<object[]> RoundTripTestParams
{ {
get get
{ {

View File

@@ -86,7 +86,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
rt.ValidateWhereClauseSingleKey(nullClause); rt.ValidateWhereClauseSingleKey(nullClause);
} }
public static IEnumerable<object> GetWhereClauseIsNotNullData public static IEnumerable<object[]> GetWhereClauseIsNotNullData
{ {
get get
{ {

View File

@@ -251,7 +251,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.Throws<ArgumentOutOfRangeException>(() => testAction(s, rowId)); Assert.Throws<ArgumentOutOfRangeException>(() => testAction(s, rowId));
} }
public static IEnumerable<object> RowIdOutOfRangeData public static IEnumerable<object[]> RowIdOutOfRangeData
{ {
get get
{ {
@@ -326,7 +326,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.ThrowsAny<ArgumentException>(() => s.Initialize(initParams, c, qr, sh, fh)); Assert.ThrowsAny<ArgumentException>(() => s.Initialize(initParams, c, qr, sh, fh));
} }
public static IEnumerable<object> InitializeNullParamsData public static IEnumerable<object[]> InitializeNullParamsData
{ {
get get
{ {

View File

@@ -1,42 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants> <DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<ApplicationIcon /> <ApplicationIcon />
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> <PackageReference Include="System.Text.Encoding.CodePages" />
<PackageReference Include="NUnit" Version="3.10.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" Version="2.2.0" /> <PackageReference Include="Moq" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> <PackageReference Include="NUnit" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" /> <PackageReference Include="xunit" />
</ItemGroup> <PackageReference Include="xunit.runner.visualstudio" />
<ItemGroup> <PackageReference Include="Microsoft.Data.SqlClient" />
<Reference Include="Newtonsoft.Json"> </ItemGroup>
<HintPath>../../bin/ref/Newtonsoft.Json.dll</HintPath> <ItemGroup>
</Reference> <ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<Reference Include="Moq"> <ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<HintPath>../../bin/ref/Moq.dll</HintPath> <ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" />
</Reference> <ProjectReference Include="../../src/Microsoft.SqlTools.ResourceProvider/Microsoft.SqlTools.ResourceProvider.csproj" />
<Reference Include="Castle.Core"> <ProjectReference Include="../../src/Microsoft.SqlTools.ResourceProvider.Core/Microsoft.SqlTools.ResourceProvider.Core.csproj" />
<HintPath>../../bin/ref/Castle.Core.dll</HintPath> <ProjectReference Include="../../src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj" />
</Reference> <ProjectReference Include="../../test/Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> </ItemGroup>
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" /> <ItemGroup>
<ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
<ProjectReference Include="../../src/Microsoft.SqlTools.ResourceProvider/Microsoft.SqlTools.ResourceProvider.csproj" /> </ItemGroup>
<ProjectReference Include="../../src/Microsoft.SqlTools.ResourceProvider.Core/Microsoft.SqlTools.ResourceProvider.Core.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj" />
<ProjectReference Include="../../test/Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="obj\Debug\netcoreapp2.2\" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project> </Project>

View File

@@ -166,7 +166,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution.Execution
Assert.ThrowsAny<Exception>(() => testMethod(resultSet)); Assert.ThrowsAny<Exception>(() => testMethod(resultSet));
} }
public static IEnumerable<object> CallMethodWithoutReadingData public static IEnumerable<object[]> CallMethodWithoutReadingData
{ {
get get
{ {
@@ -391,7 +391,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution.Execution
Assert.ThrowsAny<Exception>(() => actionToPerform(resultSet)); Assert.ThrowsAny<Exception>(() => actionToPerform(resultSet));
} }
public static IEnumerable<object> RowInvalidParameterData public static IEnumerable<object[]> RowInvalidParameterData
{ {
get get
{ {

View File

@@ -14,7 +14,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.UtilityTests
{ {
#region DecodeMultipartIdentifier Tests #region DecodeMultipartIdentifier Tests
public static IEnumerable<object> DecodeMultipartIdentifierTestData public static IEnumerable<object[]> DecodeMultipartIdentifierTestData
{ {
get get
{ {

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net461" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
</packages>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
<AssemblyName>Microsoft.SqlTools.Test.CompletionExtension</AssemblyName> <AssemblyName>Microsoft.SqlTools.Test.CompletionExtension</AssemblyName>

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>$(TestProjectsTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>