mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 01:25:40 -05:00
Support updating access token when found expired for OE (#1772)
This commit is contained in:
@@ -240,14 +240,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
/// Expands this node and returns its children
|
||||
/// </summary>
|
||||
/// <returns>Children as an IList. This is the raw children collection, not a copy</returns>
|
||||
public IList<TreeNode> Expand(string name, CancellationToken cancellationToken)
|
||||
public IList<TreeNode> Expand(string name, CancellationToken cancellationToken, string? accessToken = null)
|
||||
{
|
||||
// TODO consider why solution explorer has separate Children and Items options
|
||||
if (children.IsInitialized)
|
||||
{
|
||||
return children;
|
||||
}
|
||||
PopulateChildren(false, name, cancellationToken);
|
||||
PopulateChildren(false, name, cancellationToken, accessToken);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -255,19 +255,19 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
/// Expands this node and returns its children
|
||||
/// </summary>
|
||||
/// <returns>Children as an IList. This is the raw children collection, not a copy</returns>
|
||||
public IList<TreeNode> Expand(CancellationToken cancellationToken)
|
||||
public IList<TreeNode> Expand(CancellationToken cancellationToken, string? accessToken = null)
|
||||
{
|
||||
return Expand(null, cancellationToken);
|
||||
return Expand(null, cancellationToken, accessToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh this node and returns its children
|
||||
/// </summary>
|
||||
/// <returns>Children as an IList. This is the raw children collection, not a copy</returns>
|
||||
public virtual IList<TreeNode> Refresh(CancellationToken cancellationToken)
|
||||
public virtual IList<TreeNode> Refresh(CancellationToken cancellationToken, string? accessToken = null)
|
||||
{
|
||||
// TODO consider why solution explorer has separate Children and Items options
|
||||
PopulateChildren(true, null, cancellationToken);
|
||||
PopulateChildren(true, null, cancellationToken, accessToken);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
return Parent as T;
|
||||
}
|
||||
|
||||
protected virtual void PopulateChildren(bool refresh, string name, CancellationToken cancellationToken)
|
||||
protected virtual void PopulateChildren(bool refresh, string name, CancellationToken cancellationToken, string? accessToken = null)
|
||||
{
|
||||
Logger.Write(TraceEventType.Verbose, string.Format(CultureInfo.InvariantCulture, "Populating oe node :{0}", this.GetNodePath()));
|
||||
Debug.Assert(IsAlwaysLeaf == false);
|
||||
@@ -335,6 +335,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
children.Clear();
|
||||
BeginChildrenInit();
|
||||
|
||||
// Update access token for future queries
|
||||
context.UpdateAccessToken(accessToken);
|
||||
|
||||
try
|
||||
{
|
||||
ErrorMessage = null;
|
||||
|
||||
Reference in New Issue
Block a user