PowerShell / PowerShell/vscode-powershell

Add a public API to enable add-on extensions

Open
#2,537 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Startup Issue-Enhancement
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

Summary of the new feature

As a writer of a PowerShellEditorServices extension I want to enable users to install a vscode extension containing my module.

I need that extension to be able to:

  1. Use the integrated console to install the module from the gallery, or provide an additional PSModulePath
  2. Import the PSES extension module on vscode extension activation

I want that extension to be able to:

  1. Register new requests and notifications that PSES would redirect to my module

The current install process is as follows:

  1. Install the module manually from the gallery
  2. Add an Import-Module statement to your profile
  3. Manually add keybinds to keybinds.json (using syntax you can only determine from reading vscode-powershell's source or a posted example)

That's a lot to ask of folks just to try out a module.

Proposed technical implementation details (optional)

The getExtension function allows vscode extensions to acquire a public API from another extension. This API would need to be surfaced by vscode-powershell internally, and optionally (though ideally) a typescript type definition would also be published to npm.

The bare minimum needed in this API would be an exported function that just imports a module from a path. Something like:

tryImportPowerShellModule(path: string) => bool

Edit: Actually a simple import function would be pretty inconsistent since it would be lost every time the console was restarted/version changed. Maybe something like:

registerPSESExtensionModule(path: string) => void;

Where vscode-powershell internally tracks registered modules and reimports them at startup.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue identifies VS Code's getExtension API as the integration entry point and suggests a public TypeScript API, with optional npm type definitions. Start by tracing how vscode-powershell could surface that API and retain registered modules across console restarts; done means extensions can register or import their module and optionally register redirected requests and notifications.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript, vscode
Domain
api, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.