Skip to content

Add example of starting PSES in a script to readme #1932

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 1 commit into from
Oct 14, 2022

Conversation

pinuke
Copy link
Contributor

@pinuke pinuke commented Oct 14, 2022

Problems Solved:

Shell Hang:

Executing pwsh with the original command (the older one on top) from the readme causes shells to hang.
Not script or automation friendly.

Poor Doc Readability

The arguments list is also long enough to scroll off the screen on most devices.
Spacing them out over an array is a screen-friendly alternative.

  • However, keeping the old one is good for users who just want a quick copy-and-paste one-liner.

PR Summary

Added an automation-friendly powershell script for starting the service that doesn't hang the shell.

PR Context

The original command is long (longer than the width of most device screens), so it's not great in documentation, since it needs to be readable. The old one is being left there, so that users have access to a quick and easy copy-and-paste one-liner.

It also hangs the shell. If you run it from the command line, you have to wait for the process to exit before running anything else. Since some users may want to automate the service from PowerShell itself, it is a better practice to call the command with Start-Process instead.

# Problems Solved:

- Executing pwsh with the original command (top, the old one is left in there) causes shells to hang. Not script or automation friendly.
- The arguments list is also long enough to scroll off the screen on most devices. Spacing them out over an array that gets joined into a string is a screen-friendly alternative.
  - However, keeping the old one is good for users who just want a quick copy and paste one-liner.
@pinuke pinuke requested a review from a team as a code owner October 14, 2022 06:39
@ghost
Copy link

ghost commented Oct 14, 2022

CLA assistant check
All CLA requirements met.

@pinuke pinuke changed the title docs: add a more pwsh-friendly use case docs: add a more pwsh-friendly service starter Oct 14, 2022
@pinuke pinuke changed the title docs: add a more pwsh-friendly service starter docs: add a more pwsh-friendly service starter in the readme Oct 14, 2022
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

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

FWIW I also intend (at some point soon-ish) to make this whole thing a heck of a lot easier: #1855

@andyleejordan andyleejordan changed the title docs: add a more pwsh-friendly service starter in the readme Add example of starting PSES in a script to readme Oct 14, 2022
@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). Area-Documentation labels Oct 14, 2022
@andyleejordan andyleejordan enabled auto-merge (squash) October 14, 2022 17:52
@andyleejordan andyleejordan merged commit 9416a8a into PowerShell:main Oct 14, 2022
@pinuke
Copy link
Contributor Author

pinuke commented Oct 14, 2022

@andschwa I'm currently working on a script that acts as a manual controller for the service. The objective of the script will be to allow end users to manually control the service as well as introduce an opportunity to learn LSP.

My current idea is to setup a basic process and pipe controller, then add functions that allow users to load JSON-RPC messages from files and send them to the server to see what kind of response they get. This also gives the end user the opportunity to learn how to write LSP messages (up to and including the message header), not just how to control PSES

The interface for the controller will have 2 parts. One, a shell like interface that users can enter commands into, and two, a simple scripting engine for automating those commands.

I got the idea from a different project that I'm working on. It's a powershell command palette that minimizes to the system tray on WIndows/Ubuntu.

Here are the referenced projects and their Hackaday counterparts:

Once, I finish writing the controller, I might even request to have it referenced within this project so that users can get a tool to playtest LSP and PSES

@pinuke
Copy link
Contributor Author

pinuke commented Oct 14, 2022

I pulled that bit of code from the controller. Thought it would be useful to other people

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Documentation Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants