Skip to content

Commit 38d3a33

Browse files
authored
Fixing special file URIs like GIST for query execution. (#2509)
* Remove non-file URI check from GetFile method in Workspace class * Remove unused using directive for System.Collections.Generic in Workspace class
1 parent 4721c34 commit 38d3a33

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/Microsoft.SqlTools.ServiceLayer/Workspace/Workspace.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#nullable disable
77

88
using System;
9-
using System.Collections.Generic;
109
using System.IO;
1110
using System.Text;
1211
using System.Text.RegularExpressions;
@@ -28,13 +27,6 @@ public partial class Workspace : IDisposable
2827
#region Private Fields
2928

3029
private const string UntitledScheme = "untitled";
31-
private static readonly HashSet<string> fileUriSchemes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
32-
{
33-
"file",
34-
UntitledScheme,
35-
"tsqloutput",
36-
"vscode-notebook-cell"
37-
};
3830

3931
private ConcurrentDictionary<string, ScriptFile> workspaceFiles = new ConcurrentDictionary<string, ScriptFile>();
4032

@@ -94,10 +86,6 @@ public bool ContainsFile(string filePath)
9486
public virtual ScriptFile GetFile(string filePath)
9587
{
9688
Validate.IsNotNullOrWhitespaceString("filePath", filePath);
97-
if (IsNonFileUri(filePath))
98-
{
99-
return null;
100-
}
10189

10290
// Resolve the full file path
10391
ResolvedFile resolvedFile = this.ResolveFilePath(filePath);
@@ -221,10 +209,6 @@ public static string UnescapePath(string path)
221209
public ScriptFile GetFileBuffer(string filePath, string initialBuffer)
222210
{
223211
Validate.IsNotNullOrWhitespaceString("filePath", filePath);
224-
if (IsNonFileUri(filePath))
225-
{
226-
return null;
227-
}
228212

229213
// Resolve the full file path
230214
ResolvedFile resolvedFile = this.ResolveFilePath(filePath);
@@ -331,15 +315,6 @@ public static string GetScheme(string uri)
331315
return null;
332316
}
333317

334-
private bool IsNonFileUri(string path)
335-
{
336-
string scheme = GetScheme(path);
337-
if (!string.IsNullOrEmpty(scheme))
338-
{
339-
return !fileUriSchemes.Contains(scheme); ;
340-
}
341-
return false;
342-
}
343318

344319
private bool IsUntitled(string path)
345320
{

0 commit comments

Comments
 (0)