Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Language Server Requests Should Timeout #1976

Open
thecoolwinter opened this issue Jan 25, 2025 · 0 comments
Open

🐞 Language Server Requests Should Timeout #1976

thecoolwinter opened this issue Jan 25, 2025 · 0 comments
Labels
bug Something isn't working language server Issues or Pull Requests related to language servers.

Comments

@thecoolwinter
Copy link
Collaborator

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

@thecoolwinter thecoolwinter added bug Something isn't working language server Issues or Pull Requests related to language servers. labels Jan 25, 2025
@thecoolwinter thecoolwinter moved this from 🆕 New to 📋 Todo in CodeEdit Project Jan 25, 2025
@github-actions github-actions bot added triage needed UI This is UI related labels Jan 25, 2025
@thecoolwinter thecoolwinter removed UI This is UI related triage needed labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language server Issues or Pull Requests related to language servers.
Projects
Status: 📋 Todo
Development

No branches or pull requests

1 participant