You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[PowerShell for Visual Studio Code](https://github.com/PowerShell/vscode-powershell), also available in Azure Data Studio
18
16
-[lsp-pwsh](https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-pwsh.el), an Emacs PowerShell plugin
17
+
-[intellij-powershell](https://github.com/ant-druha/intellij-powershell), adds PowerShell language support to IntelliJ-based IDEs
18
+
-[coc-powershell](https://github.com/yatli/coc-powershell), a Vim and Neovim plugin
19
+
20
+
Please note that other than PowerShell for Visual Studio Code, these clients are community maintained and may be very out of date.
21
+
It is recommended that you simply use an LSP plugin for your editor and configure it as demonstrated [below](#Usage).
19
22
20
23
## Features
21
24
@@ -24,55 +27,67 @@ The functionality in PowerShell Editor Services is already available in the foll
24
27
- Statement completions (IntelliSense)
25
28
- Real-time semantic analysis of scripts using PowerShell Script Analyzer
26
29
- The Debugging Service simplifies interaction with the PowerShell debugger (breakpoints, variables, call stack, etc.)
27
-
- The [$psEditor API](https://github.com/PowerShell/PowerShellEditorServices/blob/main/docs/guide/extensions.md) enables scripting of the host editor
30
+
- The [$psEditor API](docs/guide/extensions.md) enables scripting of the host editor
28
31
- A full, Extension Terminal experience for interactive development and debugging
29
32
30
33
## Usage
31
34
32
-
If you're looking to integrate PowerShell Editor Services into your [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) compliant editor or client, we support two ways of connecting.
35
+
If you're looking to integrate PowerShell Editor Services into your [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) compliant editor or client,
36
+
we support two ways of connecting.
33
37
34
-
### Named Pipes/Unix Domain Sockets (recommended)
38
+
### Named Pipes / Unix Domain Sockets
35
39
36
40
If you're looking for a more feature-rich experience,
37
-
Named Pipes are the way to go.
41
+
named pipes (AKA sockets) are the way to go.
38
42
They give you all the benefits of the Language Server Protocol with extra capabilities that you can take advantage of:
39
43
40
44
- The PowerShell Extension Terminal
41
45
- Debugging using the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/)
42
46
43
-
The typical command to start PowerShell Editor Services using `stdio` is as follows:
47
+
The typical command to start PowerShell Editor Services using named pipes / sockets is as follows:
The start script, `Start-EditorServices.ps1` is found in the `PowerShellEditorServices` folder instead the `PowerShellEditorServices.zip` downloaded from the GitHub releases.
53
+
The start script, `Start-EditorServices.ps1`, is found in the `PowerShellEditorServices` folder instead the `PowerShellEditorServices.zip` downloaded from the GitHub releases.
54
+
55
+
The session details (which named pipes were created) will be written to the given session details path,
56
+
and the client needs to point to these in order to connect.
57
+
58
+
The Visual Studio Code, Vim, and IntelliJ extensions use named pipes.
59
+
60
+
### Standard Input and Output
50
61
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).
62
+
Alternatively, the `-SessionDetailsPath ./session.json` argument can be replaced with just `-Stdio`.
63
+
The use of stdio is the _simplest_ way to connect with most LSP clients,
64
+
but will limit some features, such as the debugger and Extension Terminal.
65
+
This is because because these two features require their own IO streams and stdio only provides a single pair of streams.
54
66
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.
67
+
Please see the [emacs-simple-test.el](test/emacs-simple-test.el),
68
+
[emacs-test.el](test/emacs-test.el),
69
+
[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.
70
+
They use [eglot for Emacs](https://github.com/joaotavora/eglot) and [LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim).
71
+
72
+
### Advanced Usage
58
73
59
74
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.
75
+
It also gives you access to process automation features like `$process.Close()` or `$process.Kill()`.
76
+
The `Start-EditorServices.ps1`script takes many more optional arguments, but they no longer _need_ to be specified.
The PowerShell Extension Terminal uses the host process' Stdio streams for console input and output. Please note that this is mutually exclusive from using Stdio for the language server protocol messages.
108
+
The PowerShell Extension Terminal uses the host process' stdio streams for console input and output.
109
+
Please note that this is mutually exclusive from using stdio for the Language Server Protocol messages.
96
110
97
-
If you want to take advantage of the PowerShell Extension Terminal which automatically shares state with the editor-side,
98
-
you must include the `-EnableConsoleRepl` switch when called`Start-EditorServices.ps1`.
111
+
If you want to take advantage of the PowerShell Extension Terminal,
112
+
you must include the `-EnableConsoleRepl` switch when calling`Start-EditorServices.ps1`.
99
113
100
114
This is typically used if your client can create arbitrary terminals in the editor like below:
101
115
102
-

116
+

103
117
104
118
The Visual Studio Code, Vim, and IntelliJ extensions currently use the PowerShell Extension Terminal.
105
119
106
-
####Debugging
120
+
### Debugging
107
121
108
122
Debugging support is also exposed with PowerShell Editor Services.
109
-
It is handled within the same process as the language server protocol handing.
110
-
This provides a more integrated experience for end users but is something to note as not many other language servers work in this way.
123
+
It is handled within the same process as the Language Server Protocol.
124
+
This provides a more integrated experience for end users but is something to note as not many other language servers work in the same way.
111
125
If you want to take advantage of debugging,
112
126
your client must support the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/).
113
127
Your client should use the path to the debug named pipe found in the `session.json` file talked about above.
114
128
115
129
Currently, only the Visual Studio Code extension supports debugging.
116
130
117
-
### Stdio
118
-
119
-
Stdio is a simpler and more universal mechanism for the Language Server Protocol. We recommend using it if your editor/client doesn't need to support the PowerShell Extension Terminal or debugging.
120
-
121
-
> NOTE: Debugging and the Extension Terminal are not features of the Stdio channel because each feature requires its own IO streams and since the Stdio model only provides a single set of streams (Stdio),
122
-
> these features cannot be leveraged.
123
-
124
-
The typical command to start PowerShell Editor Services using stdio is as follows:
0 commit comments