-
Notifications
You must be signed in to change notification settings - Fork 235
Improvements to REPL execution #105
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change causes RuntimeExceptions thrown during PowerShellContext.ExecuteCommand calls to be written to the host. Previously these error messages were not being written so users did not see error output for any commands using the "-ErrorAction Stop" parameter.
This change fixes a REPL execution bug in the LanguageServer which caused a NullReferenceException when the executed command failed due to an exception. The offending code was removed.
This change fixes an issue in PowerShellContext which causes a RunspaceHandle to not be disposed if an exception is thrown during command execution. A 'finally' block is now used to properly dispose of the RunspaceHandle so that future command executions can proceed.
This change improves the REPL such that the current 'prompt' function is executed and its result written to the host after the user executes a command. Existing tests which deal with console output are also updated to reflect these changes. Resolves #84.
This change adds a new parameter to PowerShellContext.ExecuteScriptString which causes the executed script string to be echoed to the host. This is useful for "run selection" operations where some selected text is executed in the REPL.
This change adds the next 'context' parameter to EvaluateRequest, allowing the debug adapter client to identify whether an 'evaluate' request will be used for evaluating an expression for value display or REPL execution. This allows us to write out REPL command output only when expressions are being evaluated in that context.
This change updates the way we execute commands in the debugger which need to have their output streamed to the console. Previously the command execution would just evaluate the expression and return the results without writing them to the host. Now for PowerShell v4/5 users, the output can be streamed as the command is being executed. For PowerShell v3 users the output will be written after the command fully completes executing.
This change fixes the current PowerShellVersionTests to use an absolute path to the version-specific PowerShell reference assembly. The relative path which was being used somehow caused MSBuild to use the in-box PowerShell v5 assemblies since the HintPath couldn't be found. This caused the tests for PowerShell 3 and 4 to pass even though they should be failing. This change also includes some fixes to existing code that is incompatible with PowerShell 3 and 4.
594b13e
to
3044b62
Compare
This change adds helpful log messages to identify the version of both the host and the PowerShell runtime on the local machine.
TylerLeonhardt
pushed a commit
to TylerLeonhardt/PowerShellEditorServices
that referenced
this pull request
Feb 26, 2019
…asks-for-pester340 Updates the examples\.vscode\tasks.json file for Pester 3.4.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes vastly improve the current state of execution of commands in the REPL both while running inside and outside of the debugger. The biggest change is that we now show the PowerShell prompt in the REPL output. We also can now stream the results of commands run in the debugger console so that the user doesn't have to wait to see output until the command finishes. Lastly, we now handle RuntimeExceptions correctly sending the error output to the host.