Update to .NET 7 SDK (#1792)

This commit is contained in:
Cheena Malhotra
2023-02-07 17:53:36 -08:00
committed by GitHub
parent 51892519ef
commit 8d119876d9
62 changed files with 169 additions and 147 deletions

View File

@@ -36,7 +36,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
{
try
{
var filters = Parameters.ObjectTypes.Select(t => MapType(t)).ToArray();
var filters = Parameters.ObjectTypes.Select(MapType).ToArray();
var objects = Model.GetObjects(DacQueryScopes.UserDefined, filters).ToList();
return objects.Select(o => new TSqlObjectInfo

View File

@@ -81,8 +81,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
Subtext = currentNode.GetDisplayLinesOfText(true),
RelativeCost = currentNode.RelativeCost,
Properties = GetProperties(currentNode.Properties),
Children = currentNode.Children.Select(x => ConvertShowPlanTreeToExecutionPlanTree(x)).ToList(),
Edges = currentNode.Edges.Select(x => ConvertShowPlanEdgeToExecutionPlanEdge(x)).ToList(),
Children = currentNode.Children.Select(ConvertShowPlanTreeToExecutionPlanTree).ToList(),
Edges = currentNode.Edges.Select(ConvertShowPlanEdgeToExecutionPlanEdge).ToList(),
Badges = GenerateNodeOverlay(currentNode),
Name = currentNode.DisplayName,
ElapsedTimeInMs = currentNode.ElapsedTimeInMs,

View File

@@ -599,7 +599,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
{
if (currentList != null &&
token != null && !string.IsNullOrWhiteSpace(token.Text) &&
token.Text.All(ch => char.IsLetter(ch)) &&
token.Text.All(char.IsLetter) &&
currentList.All(x => string.Compare(x.Label, token.Text, true) != 0
))
{

View File

@@ -1,5 +1,5 @@
// WARNING:
// This file was generated by the Microsoft DataWarehouse String Resource Tool 6.0.0.0
// This file was generated by the Microsoft DataWarehouse String Resource Tool 7.0.0.0
// from information in sr.strings
// DO NOT MODIFY THIS FILE'S CONTENTS, THEY WILL BE OVERWRITTEN
//

View File

@@ -13,6 +13,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RuntimeIdentifiers>$(ToolsServiceTargetRuntimes)</RuntimeIdentifiers>
<!-- TODO FIX THESE WARNINGS ASAP -->
<NoWarn>$(NoWarn);SYSLIB1045;CA1311;CA1854;CS8600;CS8603;CS8625</NoWarn>
</PropertyGroup>
<PropertyGroup>

View File

@@ -63,7 +63,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
public ObjectExplorerService()
{
sessionMap = new ConcurrentDictionary<string, ObjectExplorerSession>();
applicableNodeChildFactories = new Lazy<Dictionary<string, HashSet<ChildFactory>>>(() => PopulateFactories());
applicableNodeChildFactories = new Lazy<Dictionary<string, HashSet<ChildFactory>>>(PopulateFactories);
NodePathGenerator.Initialize();
}

View File

@@ -118,7 +118,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
return;
}
IEnumerable<SmoQuerier> queriers = context.ServiceProvider.GetServices<SmoQuerier>(q => IsCompatibleQuerier(q));
IEnumerable<SmoQuerier> queriers = context.ServiceProvider.GetServices<SmoQuerier>(IsCompatibleQuerier);
var filters = this.Filters.ToList();
var smoProperties = this.SmoProperties.Where(p => ServerVersionHelper.IsValidFor(serverValidFor, p.ValidFor)).Select(x => x.Name);
if (!string.IsNullOrEmpty(name))

View File

@@ -11,6 +11,7 @@ using Microsoft.SqlTools.ServiceLayer.SqlContext;
using Microsoft.SqlTools.ServiceLayer.Utility;
using Microsoft.SqlTools.Utility;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Microsoft.SqlTools.ServiceLayer
{
@@ -22,7 +23,7 @@ namespace Microsoft.SqlTools.ServiceLayer
/// <summary>
/// Main entry point into the SQL Tools API Service Layer
/// </summary>
internal static void Main(string[] args)
internal static async Task Main(string[] args)
{
SqlClientListener? sqlClientListener = null;
try
@@ -61,7 +62,7 @@ namespace Microsoft.SqlTools.ServiceLayer
ProcessExitTimer.Start(commandOptions.ParentProcessId.Value);
}
serviceHost.WaitForExit();
await serviceHost.WaitForExitAsync();
}
catch (Exception ex)
{

View File

@@ -231,7 +231,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
//Run Task synchronously
public void Run()
{
Task.Run(() => RunAsync());
Task.Run(RunAsync);
}
/// <summary>