From 44dc3181c3ac9a5cf055e8f33287270194242696 Mon Sep 17 00:00:00 2001 From: Christopher Suh Date: Fri, 8 Sep 2023 13:15:08 -0400 Subject: [PATCH] Fix clipboard (#2218) * remove clipboard set text, add field in copyresults response * fix sendResult type * change result to results --- .../QueryExecution/Contracts/CopyResultsRequest.cs | 1 + .../QueryExecution/QueryExecutionService.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/CopyResultsRequest.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/CopyResultsRequest.cs index 33c55e06..41d018bd 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/CopyResultsRequest.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/CopyResultsRequest.cs @@ -38,6 +38,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts /// public class CopyResultsRequestResult { + public string Results { get; set; } } /// diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/QueryExecutionService.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/QueryExecutionService.cs index 9efa6a60..e9c4bd3a 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/QueryExecutionService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/QueryExecutionService.cs @@ -12,7 +12,6 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using TextCopy; using Microsoft.SqlTools.Hosting.Protocol; using Microsoft.SqlTools.ServiceLayer.Connection.Contracts; using Microsoft.SqlTools.ServiceLayer.Connection; @@ -798,8 +797,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution pageStartRowIndex += rowsToFetch; } while (pageStartRowIndex < rowRange.End); } - await ClipboardService.SetTextAsync(builder.ToString()); - await requestContext.SendResult(new CopyResultsRequestResult()); + CopyResultsRequestResult result = new CopyResultsRequestResult + { + Results = builder.ToString() + }; + await requestContext.SendResult(result); } #endregion