Skip to content

Commit fd70c59

Browse files
committed
Update readme for simplified CLI
1 parent 33d4a39 commit fd70c59

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

README.md

+19-14
Original file line numberDiff line numberDiff line change
@@ -40,48 +40,53 @@ They give you all the benefits of the Language Server Protocol with extra capabi
4040
- The PowerShell Extension Terminal
4141
- Debugging using the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/)
4242

43-
The typical command to start PowerShell Editor Services using named pipes is as follows:
43+
The typical command to start PowerShell Editor Services using `stdio` is as follows:
4444

4545
```powershell
46-
pwsh -NoLogo -NoProfile -Command "$PSES_BUNDLE_PATH/PowerShellEditorServices/Start-EditorServices.ps1 -BundledModulesPath $PSES_BUNDLE_PATH -LogPath $SESSION_TEMP_PATH/logs.log -SessionDetailsPath $SESSION_TEMP_PATH/session.json -FeatureFlags @() -AdditionalModules @() -HostName 'My Client' -HostProfileId 'myclient' -HostVersion 1.0.0 -LogLevel Normal"
46+
pwsh -NoLogo -NoProfile -Command "./PowerShellEditorServices/Start-EditorServices.ps1 -Stdio"
4747
```
4848

49-
> NOTE: In the example above,
50-
>
51-
> - `$PSES_BUNDLE_PATH` is the root of the PowerShellEditorServices.zip downloaded from the GitHub releases.
52-
> - `$SESSION_TEMP_PATH` is the folder path that you'll use for this specific editor session.
49+
The start script, `Start-EditorServices.ps1` is found in the `PowerShellEditorServices` folder instead the `PowerShellEditorServices.zip` downloaded from the GitHub releases.
5350

54-
If you are trying to automate the service in PowerShell, You can also run it under `Start-Process` to prevent hanging your script. It also gives you access to Process/PID automation features like `$process.Close()` or `$process.Kill()`
51+
Alternatively, the `-Stdio` argument can be removed and the argument `-SessionDetailsPath ./session.json` added to produce a JSON file the client needs to point to in order to connect over a named pipe / socket.
52+
The use stdio is the simplest way to connect with most LSP clients,
53+
but may limit some features (such as the debugger and Extension Terminal).
54+
55+
Please see the [emacs-simple-test.el](test\emacs-simple-test.el),
56+
[emacs-test.el](test\emacs-test.el),
57+
[vim-simple-test.el](test\vim-simple-test.vim) and [vim-test.vim](test\vim-test.vim) for examples of end-to-end tested configurations.
58+
59+
If you are trying to automate the service in PowerShell, you can also run it under `Start-Process` to prevent hanging your script.
60+
It also gives you access to Process/PID automation features like `$process.Close()` or `$process.Kill()`.
61+
The script takes many more optional arguments, but they no longer _need_ to be specified.
5562

5663
```powershell
5764
$command = @(
5865
"$PSES_BUNDLE_PATH/PowerShellEditorServices/Start-EditorServices.ps1",
5966
"-BundledModulesPath $PSES_BUNDLE_PATH",
60-
"-LogPath $SESSION_TEMP_PATH/logs.log",
67+
"-LogPath $SESSION_LOGS_PATH",
6168
"-SessionDetailsPath $SESSION_TEMP_PATH/session.json",
6269
"-FeatureFlags @()",
6370
"-AdditionalModules @()",
6471
"-HostName 'My Client'",
6572
"-HostProfileId 'myclient'",
6673
"-HostVersion 1.0.0",
67-
"-LogLevel Normal"
74+
"-LogLevel Diagnostic"
6875
)-join " "
6976
7077
$pwsh_arguments = "-NoLogo -NoProfile -Command $command"
7178
$process = Start-Process pwsh -ArgumentList $arguments -PassThru
72-
7379
...
74-
7580
$process.Close(); #$process.Kill();
7681
```
7782

7883
Once the command is run,
79-
PowerShell Editor Services will wait until the client connects to the Named Pipe.
80-
The `session.json` will contain the paths of the Named Pipes that you will connect to.
84+
PowerShell Editor Services will wait until the client connects to the named pipe.
85+
The `session.json` will contain the paths of the named pipes that you will connect to.
8186
There will be one you immediately connect to for Language Server Protocol messages,
8287
and once you connect to when you launch the debugger for Debug Adapter Protocol messages.
8388

84-
The Visual Studio Code, Vim, and IntelliJ extensions currently use Named Pipes.
89+
The Visual Studio Code, Vim, and IntelliJ extensions currently can use named pipes.
8590

8691
#### PowerShell Extension Terminal
8792

test/emacs-simple-test.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; emacs-test.el --- Integration testing script -*- lexical-binding: t; -*-
1+
;;; emacs-simple-test.el --- Integration testing script -*- lexical-binding: t; -*-
22

33
;; Copyright (c) Microsoft Corporation.
44
;; Licensed under the MIT License.

0 commit comments

Comments
 (0)