mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Upgrade solution to .NET 6.0.9 (Build with .NET SDK v6.0.401) (#1692)
This commit is contained in:
@@ -60,10 +60,7 @@ namespace Microsoft.Kusto.ServiceLayer.Connection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (lockedDatabaseManager == null)
|
||||
{
|
||||
lockedDatabaseManager = DatabaseLocksManager.Instance;
|
||||
}
|
||||
lockedDatabaseManager ??= DatabaseLocksManager.Instance;
|
||||
return lockedDatabaseManager;
|
||||
}
|
||||
set
|
||||
|
||||
@@ -151,10 +151,7 @@ namespace Microsoft.Kusto.ServiceLayer.LanguageServices
|
||||
{
|
||||
get
|
||||
{
|
||||
if (workspaceServiceInstance == null)
|
||||
{
|
||||
workspaceServiceInstance = WorkspaceService<SqlToolsSettings>.Instance;
|
||||
}
|
||||
workspaceServiceInstance ??= WorkspaceService<SqlToolsSettings>.Instance;
|
||||
return workspaceServiceInstance;
|
||||
}
|
||||
set
|
||||
@@ -167,10 +164,7 @@ namespace Microsoft.Kusto.ServiceLayer.LanguageServices
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.serviceHostInstance == null)
|
||||
{
|
||||
this.serviceHostInstance = ServiceHost.Instance;
|
||||
}
|
||||
this.serviceHostInstance ??= ServiceHost.Instance;
|
||||
return this.serviceHostInstance;
|
||||
}
|
||||
set
|
||||
@@ -872,10 +866,8 @@ namespace Microsoft.Kusto.ServiceLayer.LanguageServices
|
||||
}
|
||||
|
||||
// if there are no completions then provide the default list
|
||||
if (resultCompletionItems == null) // this is the getting default keyword option when its not connected
|
||||
{
|
||||
resultCompletionItems = DataSourceFactory.GetDefaultAutoComplete(DataSourceType.Kusto, scriptDocumentInfo, textDocumentPosition.Position);
|
||||
}
|
||||
// this is the getting default keyword option when its not connected
|
||||
resultCompletionItems ??= DataSourceFactory.GetDefaultAutoComplete(DataSourceType.Kusto, scriptDocumentInfo, textDocumentPosition.Position);
|
||||
|
||||
return resultCompletionItems;
|
||||
}
|
||||
|
||||
@@ -70,10 +70,7 @@ namespace Microsoft.Kusto.ServiceLayer.ObjectExplorer.DataSourceModel
|
||||
path = schema + "." + path;
|
||||
}
|
||||
|
||||
if (path == null)
|
||||
{
|
||||
path = "";
|
||||
}
|
||||
path ??= "";
|
||||
|
||||
foreach (var matchingNode in matchingNodes)
|
||||
{
|
||||
|
||||
@@ -262,10 +262,7 @@ namespace Microsoft.Kusto.ServiceLayer.ObjectExplorer
|
||||
internal async Task HandleFindNodesRequest(FindNodesParams findNodesParams, RequestContext<FindNodesResponse> context)
|
||||
{
|
||||
var foundNodes = FindNodes(findNodesParams.SessionId, findNodesParams.Type, findNodesParams.Schema, findNodesParams.Name, findNodesParams.Database, findNodesParams.ParentObjectNames);
|
||||
if (foundNodes == null)
|
||||
{
|
||||
foundNodes = new List<TreeNode>();
|
||||
}
|
||||
foundNodes ??= new List<TreeNode>();
|
||||
await context.SendResult(new FindNodesResponse { Nodes = foundNodes.Select(node => node.ToNodeInfo()).ToList() });
|
||||
}
|
||||
|
||||
|
||||
@@ -171,9 +171,9 @@ namespace Microsoft.Kusto.ServiceLayer.QueryExecution.DataStorage
|
||||
AddCell((string)o);
|
||||
break;
|
||||
default:
|
||||
if (o is TimeSpan) //TimeSpan doesn't have TypeCode
|
||||
if (o is TimeSpan span) //TimeSpan doesn't have TypeCode
|
||||
{
|
||||
AddCell((TimeSpan)o);
|
||||
AddCell(span);
|
||||
break;
|
||||
}
|
||||
AddCell(dbCellValue.DisplayValue);
|
||||
@@ -510,10 +510,7 @@ namespace Microsoft.Kusto.ServiceLayer.QueryExecution.DataStorage
|
||||
public ExcelSheet AddSheet(string sheetName = null)
|
||||
{
|
||||
string sheetFileName = "sheet" + (sheetNames.Count + 1);
|
||||
if (sheetName == null)
|
||||
{
|
||||
sheetName = sheetFileName;
|
||||
}
|
||||
sheetName ??= sheetFileName;
|
||||
EnsureValidSheetName(sheetName);
|
||||
|
||||
sheetNames.Add(sheetName);
|
||||
|
||||
@@ -68,13 +68,10 @@ namespace Microsoft.Kusto.ServiceLayer.QueryExecution
|
||||
{
|
||||
get
|
||||
{
|
||||
if (BufferFileStreamFactory == null)
|
||||
BufferFileStreamFactory ??= new ServiceBufferFileStreamFactory
|
||||
{
|
||||
BufferFileStreamFactory = new ServiceBufferFileStreamFactory
|
||||
{
|
||||
ExecutionSettings = Settings.QueryExecutionSettings
|
||||
};
|
||||
}
|
||||
ExecutionSettings = Settings.QueryExecutionSettings
|
||||
};
|
||||
return BufferFileStreamFactory;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,7 @@ namespace Microsoft.Kusto.ServiceLayer.SqlContext
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.sqlTools == null)
|
||||
{
|
||||
this.sqlTools = new CompoundToolsSettingsValues(MssqlTools, AllSqlTools);
|
||||
}
|
||||
this.sqlTools ??= new CompoundToolsSettingsValues(MssqlTools, AllSqlTools);
|
||||
return this.sqlTools;
|
||||
}
|
||||
set
|
||||
@@ -40,10 +37,7 @@ namespace Microsoft.Kusto.ServiceLayer.SqlContext
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.mssqlTools == null)
|
||||
{
|
||||
this.mssqlTools = new SqlToolsSettingsValues(false);
|
||||
}
|
||||
this.mssqlTools ??= new SqlToolsSettingsValues(false);
|
||||
return this.mssqlTools;
|
||||
}
|
||||
set
|
||||
@@ -60,10 +54,7 @@ namespace Microsoft.Kusto.ServiceLayer.SqlContext
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.allSqlTools == null)
|
||||
{
|
||||
this.allSqlTools = new SqlToolsSettingsValues(false);
|
||||
}
|
||||
this.allSqlTools ??= new SqlToolsSettingsValues(false);
|
||||
return this.allSqlTools;
|
||||
}
|
||||
set
|
||||
|
||||
@@ -85,12 +85,9 @@ namespace Microsoft.Kusto.ServiceLayer.Utility
|
||||
}
|
||||
else // need to split values into several arrays
|
||||
{
|
||||
if (expandedList == null)
|
||||
{
|
||||
// very inefficient so delay as much as possible
|
||||
// immediately add 0th array
|
||||
expandedList = new List<List<T>> {shortList};
|
||||
}
|
||||
// very inefficient so delay as much as possible
|
||||
// immediately add 0th array
|
||||
expandedList ??= new List<List<T>> {shortList};
|
||||
|
||||
int arrayIndex = (int)(Count / this.ExpandListSize); // 0 based
|
||||
|
||||
|
||||
Reference in New Issue
Block a user