mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 01:25:40 -05:00
Create DB work in-progress (#350)
* Stage changes to other machine * Stage changes * Update SMO to fix SMO missing Login bug on macOS
This commit is contained in:
@@ -11,6 +11,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Linq;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Workspace
|
||||
{
|
||||
@@ -114,7 +115,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Workspace
|
||||
// Client sent the path in URI format, extract the local path and trim
|
||||
// any extraneous slashes
|
||||
Uri fileUri = new Uri(filePath);
|
||||
filePath = fileUri.LocalPath.TrimStart('/');
|
||||
filePath = fileUri.LocalPath;
|
||||
if (filePath.StartsWith("//") || filePath.StartsWith("\\\\"))
|
||||
{
|
||||
filePath = filePath.Substring(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Clients could specify paths with escaped space, [ and ] characters which .NET APIs
|
||||
@@ -122,6 +127,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Workspace
|
||||
// into the SqlTools engine.
|
||||
filePath = UnescapePath(filePath);
|
||||
|
||||
// switch to unix path separators on non-Windows platforms
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
filePath = filePath.Replace('\\', '/');
|
||||
}
|
||||
|
||||
// Get the absolute file path
|
||||
filePath = Path.GetFullPath(filePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user