{"id":13493576,"url":"https://github.com/PowerShell/PowerShellEditorServices","last_synced_at":"2025-03-28T12:31:58.163Z","repository":{"id":32452168,"uuid":"36031537","full_name":"PowerShell/PowerShellEditorServices","owner":"PowerShell","description":"A common platform for PowerShell development support in any editor or application!","archived":false,"fork":false,"pushed_at":"2025-03-18T21:19:17.000Z","size":8728,"stargazers_count":671,"open_issues_count":179,"forks_count":231,"subscribers_count":57,"default_branch":"main","last_synced_at":"2025-03-22T10:01:42.277Z","etag":null,"topics":["debugger","intellisense","language-server-protocol","powershell"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"VulcanJS/Vulcan","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerShell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-21T18:54:08.000Z","updated_at":"2025-03-18T20:06:15.000Z","dependencies_parsed_at":"2023-01-14T21:16:05.870Z","dependency_job_id":"ad47429b-d7f2-418d-a1b9-d9c3e9c50e1b","html_url":"https://github.com/PowerShell/PowerShellEditorServices","commit_stats":{"total_commits":2446,"total_committers":66,"mean_commits":37.06060606060606,"dds":0.7101390024529844,"last_synced_commit":"a05cba05d2077de160807e42c0711bbe3e4ea50d"},"previous_names":[],"tags_count":154,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShellEditorServices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShellEditorServices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShellEditorServices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShell%2FPowerShellEditorServices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerShell","download_url":"https://codeload.github.com/PowerShell/PowerShellEditorServices/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246030538,"owners_count":20712395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugger","intellisense","language-server-protocol","powershell"],"created_at":"2024-07-31T19:01:16.735Z","updated_at":"2025-03-28T12:31:53.153Z","avatar_url":"https://github.com/PowerShell.png","language":"C#","readme":"# PowerShell Editor Services\n\n[![CI Tests](https://github.com/PowerShell/PowerShellEditorServices/actions/workflows/ci-test.yml/badge.svg)](https://github.com/PowerShell/PowerShellEditorServices/actions/workflows/ci-test.yml)\n[![Discord](https://img.shields.io/discord/180528040881815552.svg?label=%23vscode\u0026logo=discord\u0026logoColor=white)](https://aka.ms/psdiscord)\n[![Join the chat at https://gitter.im/PowerShell/PowerShellEditorServices](https://badges.gitter.im/PowerShell/PowerShellEditorServices.svg)](https://gitter.im/PowerShell/PowerShellEditorServices?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n**PowerShell Editor Services** is a PowerShell module that provides common\nfunctionality needed to enable a consistent and robust PowerShell development\nexperience in almost any editor or integrated development environment (IDE).\n\n## [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) clients using PowerShell Editor Services:\n\nThe functionality in PowerShell Editor Services is available in the following editor extensions:\n\n- [PowerShell for Visual Studio Code](https://github.com/PowerShell/vscode-powershell), also available in Azure Data Studio\n- [lsp-pwsh](https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-pwsh.el), an Emacs PowerShell plugin\n- [intellij-powershell](https://github.com/ant-druha/intellij-powershell), adds PowerShell language support to IntelliJ-based IDEs\n- [coc-powershell](https://github.com/yatli/coc-powershell), a Vim and Neovim plugin\n- [powershell.nvim](https://github.com/TheLeoP/powershell.nvim) a Neovim plugin\n\nPlease note that other than PowerShell for Visual Studio Code, these clients are community maintained and may be very out of date.\nIt is recommended that you simply use an LSP plugin for your editor and configure it as demonstrated [below](#Usage).\n\n## Features\n\n- The Language Service provides common editor features for the PowerShell language:\n  - Code navigation actions (find references, go to definition)\n  - Statement completions (IntelliSense)\n  - Real-time semantic analysis of scripts using PowerShell Script Analyzer\n- The Debugging Service simplifies interaction with the PowerShell debugger (breakpoints, variables, call stack, etc.)\n- The [$psEditor API](docs/guide/extensions.md) enables scripting of the host editor\n- A full, Extension Terminal experience for interactive development and debugging\n\n## Usage\n\nIf you're looking to integrate PowerShell Editor Services into your [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) compliant editor or client,\nwe support two ways of connecting.\n\n### Named Pipes / Unix Domain Sockets\n\nIf you're looking for a more feature-rich experience,\nnamed pipes (AKA sockets) are the way to go.\nThey give you all the benefits of the Language Server Protocol with extra capabilities that you can take advantage of:\n\n- The PowerShell Extension Terminal\n- Debugging using the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/)\n\nThe typical command to start PowerShell Editor Services using named pipes / sockets is as follows:\n\n```powershell\npwsh -NoLogo -NoProfile -Command \"./PowerShellEditorServices/Start-EditorServices.ps1 -SessionDetailsPath ./session.json\"\n```\n\nThe start script, `Start-EditorServices.ps1`, is found in the `PowerShellEditorServices` folder instead the `PowerShellEditorServices.zip` downloaded from the GitHub releases.\n\nThe session details (which named pipes were created) will be written to the given session details path,\nand the client needs to point to these in order to connect.\n\nThe Visual Studio Code, Vim, Neovim, and IntelliJ extensions use named pipes.\n\n### Standard Input and Output\n\nAlternatively, the `-SessionDetailsPath ./session.json` argument can be replaced with just `-Stdio`.\nThe use of stdio is the _simplest_ way to connect with most LSP clients,\nbut will limit some features, such as the debugger and Extension Terminal.\nThis is because because these two features require their own IO streams and stdio only provides a single pair of streams.\n\nPlease see the [emacs-simple-test.el](test/emacs-simple-test.el),\n[emacs-test.el](test/emacs-test.el),\n[vim-simple-test.vim](test/vim-simple-test.vim) and [vim-test.vim](test/vim-test.vim) for examples of end-to-end tested configurations.\nThey use [eglot for Emacs](https://github.com/joaotavora/eglot) and [LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim).\n\n### Advanced Usage\n\nIf you are trying to automate the service in PowerShell, you can also run it under `Start-Process` to prevent hanging your script.\nIt also gives you access to process automation features like `$process.Close()` or `$process.Kill()`.\nThe `Start-EditorServices.ps1` script takes many more optional arguments, but they no longer _need_ to be specified.\n\n```powershell\n$command = @(\n    \"$PSES_BUNDLE_PATH/PowerShellEditorServices/Start-EditorServices.ps1\",\n        \"-BundledModulesPath $PSES_BUNDLE_PATH\",\n        \"-LogPath ./logs\",\n        \"-SessionDetailsPath ./session.json\",\n        \"-FeatureFlags @()\",\n        \"-AdditionalModules @()\",\n        \"-HostName 'My Client'\",\n        \"-HostProfileId 'myclient'\",\n        \"-HostVersion 1.0.0\",\n        \"-LogLevel Diagnostic\"\n) -join \" \"\n\n$pwsh_arguments = \"-NoLogo -NoProfile -Command $command\"\n$process = Start-Process pwsh -ArgumentList $arguments -PassThru\n...\n$process.Close(); #$process.Kill();\n```\n\nOnce the command is run,\nPowerShell Editor Services will wait until the client connects to the named pipe.\nThe `session.json` will contain the paths of the named pipes that you will connect to.\nThere will be one you immediately connect to for Language Server Protocol messages,\nand once you connect to when you launch the debugger for Debug Adapter Protocol messages.\n\n### PowerShell Extension Terminal\n\n![image](https://user-images.githubusercontent.com/2644648/66245084-6985da80-e6c0-11e9-9c7b-4c8476190df5.png)\n\nThe PowerShell Extension Terminal uses the host process' stdio streams for console input and output.\nPlease note that this is mutually exclusive from using stdio for the Language Server Protocol messages.\n\nIf you want to take advantage of the PowerShell Extension Terminal,\nyou must include the `-EnableConsoleRepl` switch when calling `Start-EditorServices.ps1`.\n\nThis is typically used if your client can create arbitrary terminals in the editor like below:\n\n![Extension Terminal in VS Code](https://user-images.githubusercontent.com/2644648/66245018-04ca8000-e6c0-11e9-808c-b86144149444.png)\n\nThe Visual Studio Code, Vim, and IntelliJ extensions currently use the PowerShell Extension Terminal.\n\n### Debugging\n\nDebugging support is also exposed with PowerShell Editor Services.\nIt is handled within the same process as the Language Server Protocol.\nThis provides a more integrated experience for end users but is something to note as not many other language servers work in the same way.\nIf you want to take advantage of debugging,\nyour client must support the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/).\nYour client should use the path to the debug named pipe found in the `session.json` file talked about above.\n\nThe debugging functionality in PowerShell Editor Services is available in the following editor extensions:\n\n- [PowerShell for Visual Studio Code](https://github.com/PowerShell/vscode-powershell)\n- [nvim-dap-powershell for Neovim](https://github.com/Willem-J-an/nvim-dap-powershell)\n- [powershell.nvim for Neovim](https://github.com/TheLeoP/powershell.nvim)\n- [intellij-powershell](https://github.com/ant-druha/intellij-powershell)\n\n## API Usage\n\nPlease note that we only consider the following as stable APIs that can be relied on:\n\n- Language Server Protocol connection\n- Debug Adapter Protocol connection\n- Start-up mechanism\n\nThe types of PowerShell Editor Services can change at any moment and should not be linked against in a production environment.\n\n## Development\n\n\u003e NOTE: The easiest way to manually test changes you've made in PowerShellEditorServices is to follow the [vscode-powershell development doc](https://github.com/PowerShell/vscode-powershell/blob/main/docs/development.md) to get a local build of the VS Code extension to use your local build of PowerShellEditorServices.\n\n### 1. Install PowerShell 7+\n\nInstall PowerShell 7+ with [these instructions](https://github.com/PowerShell/PowerShell#get-powershell).\n\n### 2. Clone the GitHub repository\n\n```powershell\ngit clone https://github.com/PowerShell/PowerShellEditorServices.git\n```\n\n### 3. Install [Invoke-Build](https://github.com/nightroman/Invoke-Build)\n\n```powershell\nInstall-Module InvokeBuild -Scope CurrentUser\nInstall-Module platyPS -Scope CurrentUser\n```\n\n### 4. Delete `NuGet.Config`\n\nOur NuGet configuration points to a private feed necessary for secure builds,\nand it must be committed to the repo as it is.\nThe easiest way to build without access to that private feed is to delete the file:\n\n```powershell\nRemove-Item NuGet.Config\n```\n\nPlease be careful not to commit this change in a PR.\n\nNow you're ready to build the code.\nYou can do so in one of two ways:\n\n### Building the code from PowerShell\n\n```powershell\nPS C:\\path\\to\\PowerShellEditorServices\u003e Invoke-Build Build\n```\n\n### Building the code from Visual Studio Code\n\nOpen the PowerShellEditorServices folder that you cloned locally and press \u003ckbd\u003eCtrl+Shift+B\u003c/kbd\u003e\n(or \u003ckbd\u003eCmd+Shift+B\u003c/kbd\u003e on macOS).\n\n## Code of Conduct\n\nPlease see our [Code of Conduct](CODE_OF_CONDUCT.md) before participating in this project.\n\n## Contributions Welcome\n\nWe would love to incorporate community contributions into this project. If you would like to\ncontribute code, documentation, tests, or bug reports, please read our [Contribution Guide](CONTRIBUTING.md) to learn more.\n\n## Security Note\n\nFor any security issues, please see [here](SECURITY.md).\n\n## Maintainers\n\n- Andy Jordan - [@andyleejordan](https://github.com/andyleejordan)\n- Patrick Meinecke - [@SeeminglyScience](https://github.com/SeeminglyScience)\n- Sydney Smith - [@SydneyhSmith](https://github.com/SydneyhSmith)\n- Justin Grote - [@JustinGrote](https://github.com/JustinGrote)\n\n### Emeriti\n\n- Rob Holt - [@rjmholt](https://github.com/rjmholt)\n- Tyler Leonhardt - [@TylerLeonhardt](https://github.com/TylerLeonhardt)\n- David Wilson - [@daviwil](https://github.com/daviwil)\n\n## License\n\nThis project is [licensed under the MIT License](LICENSE). Please see the\n[third-party notices](NOTICE.txt) file for details on the third-party\nbinaries that we include with releases of this project.\n","funding_links":[],"categories":["C# #","C#","C\\#","Languages"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPowerShell%2FPowerShellEditorServices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPowerShell%2FPowerShellEditorServices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPowerShell%2FPowerShellEditorServices/lists"}