PowerShell / PowerShell/PowerShellEditorServices

Provide diagnostic marker API in $psEditor

未关闭
#235 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Issue-Enhancement
主要语言
C#
星标
767
派生
266
平均合并
3 天 16 小时
30 天内合并 PR
1

描述

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?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先查看现有的 $psEditor 文件 API 和 issue #213,以了解诊断标记将如何被使用。确定标记层和命名设计,然后定义 SetMarkers 和 ClearMarkers 针对任意文件区域及每个层的行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, powershell
领域
api, developer-experience
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。