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

refactor(language-lsp): improve signature help trigger, basic diagnostics support #635

Merged
merged 4 commits into from
Dec 14, 2024

Conversation

dingyi222666
Copy link
Contributor

@dingyi222666 dingyi222666 commented Dec 10, 2024

  • Improve the signature help trigger logic by adding support for triggering it when the selection changes and the character at the selection's left boundary matches a specific condition.
  • Adjust thread usage in LspEditor to ensure that the sleep operation is performed on a background thread using Dispatchers.IO.
  • Remove the FIXME comment in DefaultLanguageClient, as the support for diagnostics is now implemented.
  • Change the StreamProvider interface in CustomConnectProvider to a functional interface, simplifying its usage and improving code readability.
  • Implemented diagnostic request and publishing logic within the event handling mechanism.
  • Updated the request manager to support diagnostic requests.
  • Adjusted event data handling for diagnostics to improve type safety and clarity.

- Remove an unnecessary logging statement from LspLanguage to reduce noise and improve performance.
- Improve the signature help trigger logic by adding support for triggering it when the selection changes and the character at the selection's left boundary matches a specific condition.
- Adjust thread usage in LspEditor to ensure that the `sleep` operation is performed on a background thread using `Dispatchers.IO`.
- Remove the `FIXME` comment in DefaultLanguageClient, as the support for diagnostics is now implemented.
- Change the `StreamProvider` interface in CustomConnectProvider to a functional interface, simplifying its usage and improving code readability.
- Add logging statement in `LspCompletionItem` for debugging purposes.
…ead.sleep` with `delay` for pausing execution during LSP connection retries.

This change utilizes Kotlin coroutines for asynchronous operations and avoids blocking the thread.
This commit implements basic diagnostics support for the LSP client.

- Added event listeners for content and selection changes to trigger diagnostic requests.
- Implemented diagnostic request and publishing logic within the event handling mechanism.
- Updated the request manager to support diagnostic requests.
- Adjusted event data handling for diagnostics to improve type safety and clarity.
@dingyi222666 dingyi222666 changed the title refactor(language-lsp): improve signature help trigger refactor(language-lsp): improve signature help trigger, basic diagnostics support Dec 14, 2024
This change addresses a potential bug where diagnostics were being updated from a background thread, potentially leading to unexpected behavior or crashes.
@Rosemoe Rosemoe merged commit b13130a into Rosemoe:main Dec 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants