Skip to content

Improve PowerShell session management, status reporting, and logging #350

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 4 commits into from
Dec 1, 2016

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Nov 28, 2016

This change introduces a pretty large refactoring of the existing extension code to improve the overall user experience. Here is a summary of the changes:

  • The PowerShell session is now restartable at any time while VS Code is running without restarting the whole VS Code window. This is exposed through the "Restart Current Session" command.
  • A new status indicator has been added to the status bar which lets the user know when the language server is starting, running, or in an error state.
  • A new session menu, accessible from the status bar indicator, allows the user to easily switch their PowerShell session between x86/x64 and a specific PowerShell exe path.
  • Logs for the extension are now written to an output channel in the UI allowing the user to show them at any time with the "Show PowerShell Extension Logs" command.
  • Any failure to load the PowerShell session will show an error message to the user and give them the opportunity to show the extension logs.
  • If the PowerShell process ends unexpectedly at any time, the user will be shown a prompt to restart the session.
  • Logs for each session are now written out to individual log folders instead of creating them all in the same folder.

Resolves #281.

@daviwil
Copy link
Contributor Author

daviwil commented Nov 28, 2016

This is a pretty big change so I'll give @rkeithhill a chance to take a look before merging :)

Copy link
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! You've been busy. From what I can tell, looking at all the changes, it looks good. Then again, my TypeScript/JavaScript Fu is weak compared to my C# Fu.

if (logLevel >= this.MinimumLogLevel) {
// TODO: Add timestamp
this.logChannel.appendLine(message);
fs.appendFile(this.logFilePath, message + "\r\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these line endings change to \n for Linux and macOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah, good point. In fact, I need to verify that this all works correctly on Linux/macOS anyway, so I'll change that before I merge.

@daviwil daviwil added this to the 0.8.0 milestone Nov 29, 2016
This change introduces a pretty large refactoring of the existing
extension code to improve the overall user experience.  Here is a summary
of the changes:

- The PowerShell session is now restartable at any time while VS Code is
  running without restarting the whole VS Code window.  This is exposed
  through the "Restart PowerShell Session" command.
- A new status indicator has been added to the status bar which lets the
  user know when the language server is starting, running, or in an error
  state.
- Logs for the extension are now written to an output channel in the UI
  allowing the user to show them at any time with the "Show PowerShell
  Extension Logs" command.
- Any failure to load the PowerShell session will show an error message to
  the user and give them the opportunity to show the extension logs.
- If the PowerShell process ends unexpectedly at any time, the user will
  be shown a prompt to restart the session.
- Logs for each session are now written out to individual log folders
  instead of creating them all in the same folder.

Resolves #281.
@daviwil daviwil force-pushed the daviwil/extension-refactor branch from a4b1257 to 636cb90 Compare November 29, 2016 16:20
@daviwil
Copy link
Contributor Author

daviwil commented Nov 30, 2016

@rkeithhill Quick question: which nomenclature do you think is more appropriate for PowerShell folks, 32-bit/64-bit or x86/x64? The former is clearer but the latter seems to be used for the Windows PowerShell shortcuts (x86 at least).

@rkeithhill
Copy link
Contributor

I'd go with the latter for the reason you mention - names of shortcuts and what shows up in the window title.

This change completes the session management menu which allows the user to
easily switch or restart their PowerShell session.  It also improves log
creation across sessions.
@daviwil daviwil force-pushed the daviwil/extension-refactor branch from 636cb90 to 5f60fc3 Compare December 1, 2016 15:46
@daviwil daviwil merged commit 3944fa2 into master Dec 1, 2016
@daviwil daviwil deleted the daviwil/extension-refactor branch December 1, 2016 15:47
@@ -32,16 +32,17 @@
"vscode-languageclient": "1.3.1"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it missing "vscode-jsonrpc" ? I cannot compile it without adding "vscode-jsonrpc" as a dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that shouldn't be the case, I'll come by your office later to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants