Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add LSP diagnostics to completion requests

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

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
clojure
领域
tooling

调研方向

The issue does not identify ECA files, tests, or entry points; first locate how completion requests are assembled and where LSP data is available. Resolve the open questions about which diagnostics to include, scope, and configurability before implementation; done means completion requests carry the agreed diagnostic context, with tests covering the chosen behavior.

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

描述

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Completion (aka next edit prediction, ai autocomplete, ai tab complete, etc) would benefit from LSP diagnostics.

Prior Art
Cursor

Info pulled from minified JS via an Agent. Take with a grain of salt.

Example JSON

The following JSON snippet is an example payload based on the keys in the bundle. This unfortunately was not logged or pulled from a running application.

{
  "linterErrors": {
    "relativeWorkspacePath": "src/parser.rs",
    "errors": [
      {
        "message": "expected `;`, found `}`",
        "source": "rustc",
        "uri": "file:///project/src/parser.rs",
        "severity": "ERROR",
        "range": {
          "startPosition": { "line": 42, "column": 5 },
          "endPosition": { "line": 42, "column": 6 }
        },
        "relatedInformation": []
      }
    ]
  },
  "lspSuggestedItems": { "suggestions": [{ "label": "parse_expr" }] },
  "parameterHints": [
    {
      "label": "fn read(path: &Path) -> Result<String, Error>",
      "documentation": "Reads the entire file into a string."
    }
  ],
  "lspContexts": []
}

(Real requests include many non-LSP fields: currentFile, diff histories, workspaceId, codeResults, timing, etc.)

Scope
  • linterErrors is for the current file only.
  • additionalFiles (visible-range snippets, paths, open files, recently viewed, etc.) can include other buffers when enableRvfTracking is enabled.
Zed

Zed is open source! Much easier to read. Zed sends LSP context in the user prompt. It looks like LSP diagnostics get serialized to a token friendly format and embedded into the prompt.

Link to Diagnostic type def
Link to collect_diagnostics
Link to user prompt type def

Zed also sends related_files from go to definition (from users cursor) and type defintions.

Outstanding Questions
  • What LSP info should be included in the completion request
    • Should the selected diagnostics be configurable in ECA config?
  • Would any other request types benefit from LSP information?
  • Should diagnostics be limited to the file being editted or should it include full workspace diagnostics?
    • It looks like Cursor and zed both support this but have booleans to enable. There is probably a reason for the boolean. May be good to test.
主要语言
Clojure
星标
1k
派生
82
平均合并
1 天 14 小时
30 天内合并 PR
16

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

editor-code-assistant/eca 的其他 Issue

查看 editor-code-assistant/eca 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

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