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

🐞 Language Server Requests Should Timeout

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
swift
领域
devtools

调研方向

首先定位 CodeEdit 中 language server 请求和关闭处理的位置,然后使用 Xcode 16 随附的 sourcekit-lsp 二进制文件重现该问题。定义普通请求、长时间运行请求和即时请求的超时行为;完成的标准是请求不再无限期等待,并且退出情况允许退出。

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

描述

bug language server
Description

There is a chance that language servers (maliciously or due to a bug) may not respond to requests made by the client (CodeEdit). This can cause problems, for example:

  • Memory build up as syntax token requests pile up with no responses.
  • App refusing to quit before the language server exits, but the language server does not respond to the exit message.
  • UI hanging forever after a request (eg for a definition search).

In each of these cases one solution would be to time out the request. I think our LSP requests should have a default timeout length.

This has the caveat for requests that may take a long time. Those requests will need to be overridable so they can take longer. The same goes for requests that need immediate response (like the exit message), which will need to be shorter.

To Reproduce

The sourcekit-lsp binary that ships with Xcode 16 is bugged, and will not respond to the exit message. This leaves CodeEdit hanging when quitting the app and requires a force quit.

The same LSP does not respond to semantic token requests (despite declaring the capability, this is a bug with sourcekit-lsp). This may cause cached request handlers to build up over time.

Expected Behavior

Each language server request should have a timeout parameter. This likely means creating a new LanguageServer connection type that passes messages through to another type, but provides a timeout handler for requests. This may be something we can contribute back to the LanguageServer package.

Version Information

CodeEdit: 0.3.3

Additional Context

No response

Screenshots

No response

主要语言
Swift
星标
23k
派生
1.2k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

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

CodeEditApp/CodeEdit 的其他 Issue

查看 CodeEditApp/CodeEdit 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

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