PowerShell / PowerShell/PowerShellEditorServices

Discuss new Framework API structure

Open
#469 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This issue is intended to be a discussion point for the new PowerShell Editor Services API model. The idea here is that Editor Services will now become a framework for adding new capabilities to editors that use it. The overall goal being that most non-core functionality will be enabled through modules that plug into the Editor Services APIs. PSScriptAnalyzer, Plaster, and other modules will add functionality directly through these APIs rather than PSES having to know about them and manage their integration.

Interfaces

All of these interface and method are subject to change as we develop the ideas further.

  • IWorkspace - Provides access to the files in the current workspace and events for when files are opened, closed, changed, or saved
  • ILogger - Writing logs to the Editor Services log. Important for module integrations to log their activities
  • IFileMarkers - Adding markers to files, like those from PSScriptAnalyzer. Also providing quick fixes for these markers
  • IMessageHandlers - Registering message handlers for both Language Server Protocol messages and custom message types
  • ICodeLensProvider - Providing "code lenses" at arbitrary locations in the script which provide information and launch actions at that point
  • IEditorCommands - Registering extension commands in the editor which show up in the command palette
  • ICompletionsProvider - Providing custom completions (and snippets) in addition to the built-in completions and snippets
  • IFileSymbols - Gathering information about symbols in a particular file
  • IWorkspaceSymbols - Gathering information about symbols across the workspace
  • IWindowMessages (?) - Showing messages in the editor window (ShowErrorMessage, etc)
  • IWindowPrompts - Showing prompts natively in the editor's UI, mirrors the prompting functionality in the PSHostUserInterface API
  • IDebuggerCommmands - Provides commands for the debugger, like breaking, stepping, continuing, etc
  • IDebuggerEvents - Exposes events for the debugger, primarily around stopping and resuming
  • IRunspaceEvents - Exposes events for when the active runspace changes, like when a remote session is established
  • ICommandExecution - Commands for executing commands against the current runspace. Also exposes events that give state change information for command execution

TODO: Add more interfaces here

Please feel free to leave comments below to discuss APIs you'd like to see!

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 names no files, tests, or entry points. Start by reviewing the current Editor Services API structure and the listed interface proposals; this discussion is not complete until a concrete API scope and implementation target have been agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, developer-experience, tooling
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.