-
Notifications
You must be signed in to change notification settings - Fork 234
Load only bundled PSReadLine
#1514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0eb3c03
to
bced2f8
Compare
The only other way I can see to do this is with the |
7fd535d
to
cb54809
Compare
PSReadLine
Hey guys, could this potentially be why my tests are failing for my constrained runspace support branch? When CanLaunchScriptWithNoBreakpointsAsync runs, it throws
Which led me to this issue that points to PSReadLine as a potential culprit, which then led me here. I'm unable to reproduce the issue locally, which is infuriating, but I see |
src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs
Outdated
Show resolved
Hide resolved
I meant to open this PR as a draft. |
src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs
Outdated
Show resolved
Hide resolved
@rjmholt My proposed changes assume that the module has been loaded earlier in PowerShellContextService.Create |
13c63ac
to
83db232
Compare
Ok, not it's tested and ready. |
src/PowerShellEditorServices/Services/PowerShellContext/Session/PSReadLinePromptContext.cs
Outdated
Show resolved
Hide resolved
83db232
to
c3a4383
Compare
476db89
to
8ee4fd1
Compare
8ee4fd1
to
c61acce
Compare
@@ -22,26 +22,15 @@ internal class PSReadLinePromptContext : IPromptContext | |||
"..", | |||
"..", | |||
"..", | |||
#if TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OHH @rjmholt this won't work because we need it defined during test compilation but for this project. Ugh how on earth do we do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that it can be used independent of the context service.
This cannot be in project files because we need it set for all projects. So we use an `ExtraDefineConstants` in the common properties file, and then add `TEST` to it at the time we run (and build) the tests themselves.
Which asserts that we can successfully load PSReadLine.
c61acce
to
f7b69d5
Compare
Because for now it's broken.
[SkippableFact] | ||
public async Task CanGetPSReadLineProxy() | ||
{ | ||
Skip.If(IsWindows, "This test doesn't work on Windows for some reason."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjmholt For later debugging 😭
This redoes prior work that was lost during the rewrite. Specifically this actually respects the user configuration of `BundledModulePath` (also used by unit tests to provide compatibililty with xUnit), and forces the use of only our bundled PSReadLine dependency. Essentially this redoes #1514 and #1522.
This redoes prior work that was lost during the rewrite. Specifically this actually respects the user configuration of `BundledModulePath` (also used by unit tests to provide compatibililty with xUnit), and forces the use of only our bundled PSReadLine dependency. Essentially this redoes #1514 and #1522.
This definitely would resolve #1493, but @rjmholt I have a hunch there's a better way to load a bundled dependency. That is: I think we were using this inline script only so we could support loading any arbitrary version of PSReadLine, and since we're deprecating that behavior, there's probably a way to just straight up load it into the session without executing some script like this.