PowerShell / PowerShell/PowerShellEditorServices

Redesign ExtensionService to use granular feature interfaces

Open
#313 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Enhancement
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

Right now all editor features are exposed through a monolithic interface IEditorOperations. I think it would be better to go with a model that depends on more granular interfaces like IEditorWindowFeature which can be registered with the ExtensionService at runtime to light up that feature in the $psEditor API.

An editor integration may not want or need to expose all of the possible $psEditor features (like the $psEditor.Window section). If the editor did not register the feature interface of a particular part of the API, we would throw a NotImplementedException when the methods of that API are called. To allow callers to know whether the API is supported or not, we could provide an object on $psEditor which indicates which high-level parts of the API are supported.

This will also help with registering editor-specific feature APIs. For instance, if there are APIs which are only relevant to the VS Code editor, a feature interface could be registered for that only when the PSES language server is launched from VS Code. For any other editor, those APIs wouldn't be visible to the PowerShell session (only exposed via a "note property" added at runtime). Any developer interacting the EditorObject at runtime via C# could be able to query for the VS Code feature interface to see if those APIs are available.

Still thinking this through...

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

Start by reading ExtensionService, IEditorOperations, IEditorWindowFeature, and EditorObject to understand the current editor API and registration model. The issue is done when granular features can be registered independently, unsupported APIs are handled as described, and callers can query supported high-level features.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.