Skip to content

Commit 8aec52d

Browse files
committed
WIP
1 parent 974e92e commit 8aec52d

2 files changed

Lines changed: 20 additions & 14 deletions

File tree

src/PowerShellEditorServices.Hosting/packages.lock.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
"version": 1,
33
"dependencies": {
44
".NETFramework,Version=v4.6.2": {
5-
"Microsoft.NETFramework.ReferenceAssemblies": {
6-
"type": "Direct",
7-
"requested": "[1.0.3, )",
8-
"resolved": "1.0.3",
9-
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
10-
"dependencies": {
11-
"Microsoft.NETFramework.ReferenceAssemblies.net462": "1.0.3"
12-
}
13-
},
145
"NETStandard.Library": {
156
"type": "Direct",
167
"requested": "[2.0.3, )",
@@ -175,11 +166,6 @@
175166
"resolved": "1.1.0",
176167
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
177168
},
178-
"Microsoft.NETFramework.ReferenceAssemblies.net462": {
179-
"type": "Transitive",
180-
"resolved": "1.0.3",
181-
"contentHash": "IzAV30z22ESCeQfxP29oVf4qEo8fBGXLXSU6oacv/9Iqe6PzgHDKCaWfwMBak7bSJQM0F5boXWoZS+kChztRIQ=="
182-
},
183169
"Microsoft.VisualStudio.Threading": {
184170
"type": "Transitive",
185171
"resolved": "17.6.40",

test/PowerShellEditorServices.Test/Debugging/DebugServiceTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,32 @@ public DebugServiceTests()
7878
variableScriptFile = GetDebugScript("VariableTest.ps1");
7979
string variableScriptFilePath = TestUtilities.GetSharedPath(Path.Combine("Debugging", "VariableTest.ps1"));
8080
dynamic psitem = psesHost.ExecutePSCommandAsync<dynamic>(new PSCommand().AddCommand("Get-Item").AddParameter("LiteralPath", variableScriptFilePath), CancellationToken.None).GetAwaiter().GetResult().FirstOrDefault();
81+
string psPath = psitem.PSPath.ToString();
82+
83+
84+
85+
8186
Uri fileUri = new Uri(psitem.FullName);
8287
string pspathUriString = new DocumentUri(scheme: "pspath", authority: $"{psitem.PSProvider.ToString().Replace("\\", "-")}", path: $"/{fileUri.AbsolutePath}", query: string.Empty, fragment: string.Empty).ToString();
8388
// pspath://microsoft.powershell.core-filesystem/c:/Users/dkattan/source/repos/immybot-ref/submodules/PowerShellEditorServices/test/PowerShellEditorServices.Test.Shared/Debugging/VariableTest.ps1
8489
psProviderPathScriptFile = workspace.GetFile(pspathUriString);
8590
}
8691

92+
// the following function converts Microsoft.PowerShell.Core\FileSystem::C:\Users\dkattan\source\repos\immybot-ref\submodules\PowerShellEditorServices\test\PowerShellEditorServices.Test.Shared\Debugging\VariableTest.ps1 to filesystem://c:/Users/dkattan/source/repos/immybot-ref/submodules/PowerShellEditorServices/test/PowerShellEditorServices.Test.Shared/Debugging/VariableTest.ps1
93+
private string ConvertPSPathToUri(string pspath)
94+
{
95+
string[] pspathParts = pspath.Split("::");
96+
string[] provider = pspathParts[0];
97+
if (provider.Contains("\\"))
98+
{
99+
provider = provider.Split("\\")[1];
100+
}
101+
string[] driveAndPath = pspathParts[1].Split("\\");
102+
string drive = driveAndPath[0];
103+
string path = driveAndPath[1];
104+
return new DocumentUri(scheme: "filesystem", authority: string.Empty, path: $"/{drive}:{path}", query: string.Empty, fragment: string.Empty).ToString();
105+
}
106+
87107
public void Dispose()
88108
{
89109
debugService.Abort();

0 commit comments

Comments
 (0)