🐞 Language Server Requests Should Timeout
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by locating CodeEdit's language-server request and shutdown handling, then reproduce the issue with the sourcekit-lsp binary shipped in Xcode 16. Define timeout behavior for ordinary, long-running, and immediate requests; done means requests no longer wait indefinitely and the exit case allows quitting.
Written by the indexing model from the issue text.
Description
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
exitmessage. - 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
- Dominant language
- Swift
- Stars
- 23k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CodeEditApp/CodeEdit
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CodeEditApp/CodeEdit#2190 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 15/100
CodeEditApp/CodeEdit#2195 · 7 reactions ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
CodeEditApp/CodeEdit#2185 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
CodeEditApp/CodeEdit#2181 ·
-
creashes on starting Openbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
CodeEditApp/CodeEdit#2180 ·
All issues in CodeEditApp/CodeEdit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/google-cloud-swift#1151 ·
-
`--app` focus through the daemon can pick an off-screen window and refuse with `axElementNotFound` Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P1
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
code health
Difficulty 1/5 Under an hour Newbie friendliness 72/100
apple/coreai-models#288 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100