Skip to content

Commit 27cc293

Browse files
aasimkhan30Aasim Khan
andauthored
Remove URI escaping from workspace service. (#2588)
* Fix URI escaping. * Removing more escapes. * Remove local settings configuration * Updating semantic kernel --------- Co-authored-by: Aasim Khan <aasimkhan@gmail.com>
1 parent 3087950 commit 27cc293

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<PackageReference Update="SkiaSharp" Version="2.88.6" />
5757
<PackageReference Update="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" Condition="$([MSBuild]::IsOsPlatform('Linux'))" />
5858
<PackageReference Update="TextCopy" Version="6.2.1" />
59-
<PackageReference Update="Microsoft.SemanticKernel" Version="1.70.0" />
59+
<PackageReference Update="Microsoft.SemanticKernel" Version="1.71.0" />
6060

6161
<PackageReference Update="OpenAI" Version="2.8.0" />
6262
<PackageReference Update="System.ClientModel" Version="1.8.1" />

src/Microsoft.SqlTools.ServiceLayer/LanguageServices/LanguageService.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -709,12 +709,8 @@ public async Task DoHandleRebuildIntellisenseNotification(RebuildIntelliSensePar
709709
{
710710
Logger.Verbose("HandleRebuildIntelliSenseNotification");
711711

712-
// This URI doesn't come in escaped - so if it's a file path with reserved characters (such as %)
713-
// then we'll fail to find it since GetFile expects the URI to be a fully-escaped URI as that's
714-
// what the document events are sent in as.
715-
var escapedOwnerUri = Uri.EscapeDataString(rebuildParams.OwnerUri);
716712
// Skip closing this file if the file doesn't exist
717-
var scriptFile = this.CurrentWorkspace.GetFile(escapedOwnerUri);
713+
var scriptFile = this.CurrentWorkspace.GetFile(rebuildParams.OwnerUri);
718714
if (scriptFile == null)
719715
{
720716
return;
@@ -1070,10 +1066,7 @@ internal async Task PrepopulateCommonMetadata(
10701066
{
10711067
if (scriptInfo.IsConnected)
10721068
{
1073-
// This URI doesn't come in escaped - so if it's a file path with reserved characters (such as %)
1074-
// then we'll fail to find it since GetFile expects the URI to be a fully-escaped URI as that's
1075-
// what the document events are sent in as.
1076-
var fileUri = Uri.EscapeUriString(info.OwnerUri);
1069+
var fileUri = info.OwnerUri;
10771070
var scriptFile = CurrentWorkspace.GetFile(fileUri);
10781071
if (scriptFile == null)
10791072
{

src/Microsoft.SqlTools.ServiceLayer/NotebookConvert/NotebookConvertService.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ internal async Task HandleConvertNotebookToSqlRequest(ConvertNotebookToSqlParams
8989

9090
internal async Task HandleConvertSqlToNotebookRequest(ConvertSqlToNotebookParams parameters, RequestContext<ConvertSqlToNotebookResult> requestContext)
9191
{
92-
// This URI doesn't come in escaped - so if it's a file path with reserved characters (such as %)
93-
// then we'll fail to find it since GetFile expects the URI to be a fully-escaped URI as that's
94-
// what the document events are sent in as.
95-
var escapedClientUri = Uri.EscapeUriString(parameters.ClientUri);
96-
var file = WorkspaceService<SqlToolsSettings>.Instance.Workspace.GetFile(escapedClientUri);
92+
var file = WorkspaceService<SqlToolsSettings>.Instance.Workspace.GetFile(parameters.ClientUri);
9793
// Temporary notebook that we just fill in with the sql until the parsing logic is added
9894
var result = new ConvertSqlToNotebookResult
9995
{

src/Microsoft.SqlTools.ServiceLayer/QueryExecution/QueryExecutionService.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,20 +1582,16 @@ private async Task SaveResultsHelper(SaveResultsRequestParams saveParams,
15821582
// Internal for testing purposes
15831583
internal string GetSqlText(ExecuteRequestParamsBase request)
15841584
{
1585-
// This URI doesn't come in escaped - so if it's a file path with reserved characters (such as %)
1586-
// then we'll fail to find it since GetFile expects the URI to be a fully-escaped URI as that's
1587-
// what the document events are sent in as.
1588-
var escapedOwnerUri = Uri.EscapeUriString(request.OwnerUri);
15891585
// If it is a document selection, we'll retrieve the text from the document
15901586
if (request is ExecuteDocumentSelectionParams docRequest)
15911587
{
1592-
return GetSqlTextFromSelectionData(escapedOwnerUri, docRequest.QuerySelection);
1588+
return GetSqlTextFromSelectionData(request.OwnerUri, docRequest.QuerySelection);
15931589
}
15941590

15951591
// If it is a document statement, we'll retrieve the text from the document
15961592
if (request is ExecuteDocumentStatementParams stmtRequest)
15971593
{
1598-
return GetSqlStatementAtPosition(escapedOwnerUri, stmtRequest.Line, stmtRequest.Column);
1594+
return GetSqlStatementAtPosition(request.OwnerUri, stmtRequest.Line, stmtRequest.Column);
15991595
}
16001596

16011597
// If it is an ExecuteStringParams, return the text as is

0 commit comments

Comments
 (0)