mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Add more logging to GetSignatureHelp (#1717)
* Add more logging to GetSignatureHelp * cleanup * cleanup
This commit is contained in:
@@ -89,18 +89,12 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
/// </summary>
|
||||
public virtual QueueItem QueueBindingOperation(
|
||||
string key,
|
||||
Func<IBindingContext, CancellationToken, object> bindOperation,
|
||||
Func<IBindingContext, object> timeoutOperation = null,
|
||||
Func<Exception, object> errorHandler = null,
|
||||
Func<IBindingContext, CancellationToken, object?> bindOperation,
|
||||
Func<IBindingContext, object>? timeoutOperation = null,
|
||||
Func<Exception, object>? errorHandler = null,
|
||||
int? bindingTimeout = null,
|
||||
int? waitForLockTimeout = null)
|
||||
{
|
||||
// don't add null operations to the binding queue
|
||||
if (bindOperation == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
QueueItem queueItem = new QueueItem()
|
||||
{
|
||||
Key = key,
|
||||
|
||||
@@ -1551,11 +1551,12 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Verbose($"GetSignatureHelp - Didn't get any method locations from parse result");
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
queueItem.ItemProcessed.WaitOne();
|
||||
Logger.Verbose($"GetSignatureHelp - Got result {queueItem.Result}");
|
||||
return queueItem.GetResultAsT<SignatureHelp>();
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -29,12 +29,12 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
/// <summary>
|
||||
/// Gets or sets the bind operation callback method
|
||||
/// </summary>
|
||||
public Func<IBindingContext, CancellationToken, object> BindOperation { get; set; }
|
||||
public Func<IBindingContext, CancellationToken, object?> BindOperation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timeout operation to call if the bind operation doesn't finish within timeout period
|
||||
/// </summary>
|
||||
public Func<IBindingContext, object> TimeoutOperation { get; set; }
|
||||
public Func<IBindingContext, object>? TimeoutOperation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the operation to call if the bind operation encounters an unexpected exception.
|
||||
@@ -66,7 +66,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
/// <summary>
|
||||
/// Converts the result of the execution to type T
|
||||
/// </summary>
|
||||
public T GetResultAsT<T>() where T : class
|
||||
public T? GetResultAsT<T>() where T : class
|
||||
{
|
||||
//var task = this.ResultsTask;
|
||||
return (this.Result != null)
|
||||
|
||||
Reference in New Issue
Block a user