PowerShell / PowerShell/PowerShellEditorServices

Provide diagnostic marker API in $psEditor

Open
#235 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

It would be useful if there was an API to add diagnostic markers to script files so that any editor command could add "squigglies" to arbitrary regions of an open file. Markers would be added in relation to a named "layer" which would allow Editor Services to keep track of a unique set of markers for each module or use case.

The API might look something like this:

$file = $context.CurrentFile
# OR: $file = $psEditor.Workspace.GetFile("filePath.ext")
$file.SetMarkers("MarkerLayerName", markerArray)

We should also provide an API for clearing markers, either for a specific layer or for all layers:

$file.ClearMarkers("MarkerLayerName")
$file.ClearMarkers()

Once this API exists, I'll use it to implement the new integration model for PSScriptAnalyzer in issue #213.

FEEDBACK NEEDED: Is SetMarkers good enough or should it be SetFileMarkers, SetDiagnosticMarkers or something else?

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 reviewing the existing $psEditor file API and issue #213 to understand how diagnostic markers would be consumed. Resolve the marker-layer and naming design, then define the SetMarkers and ClearMarkers behavior for arbitrary file regions and each layer.

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
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.