Closed maks-ivanov closed 1 week ago
In the initialize
method of JdtlsClient
(lines 45-70 in lsproxy/src/lsp/languages/java.rs
), there is a potential bug where the tokio::time::timeout
function is used to wait for a "ServiceReady" notification. If the timeout occurs, it will return an error, but this error is not handled, which could lead to an ungraceful failure. It would be beneficial to handle the timeout error to provide a more informative error message or to retry the operation.
In the remove_notification
method of PendingRequests
(lines 139-144 in lsproxy/src/lsp/json_rpc.rs
), there is a potential issue where the function returns an Option<Sender<JsonRpcMessage>>
, but the caller does not check if the returned value is None
before calling send
on it. This could lead to a panic if the notification key does not exist in the map.
Description
PublishDiagnosticsClientCapabilities
and improved request handling withPendingRequests
.InnerMessage
andExpectedMessageKey
.Changes walkthrough
client.rs
Enhance LSP client initialization and request handling
lsproxy/src/lsp/client.rs
PublishDiagnosticsClientCapabilities
to client capabilities.PendingRequests
to useadd_request
andremove_request
.ExpectedMessageKey
.json_rpc.rs
Refactor JSON-RPC message handling and pending requests
lsproxy/src/lsp/json_rpc.rs
InnerMessage
andExpectedMessageKey
structs.PendingRequests
to handle both requests and notifications.java.rs
Improve Java LSP client initialization and configuration
lsproxy/src/lsp/languages/java.rs
process.rs
Clean up process handling by removing debug logs
lsproxy/src/lsp/process.rs - Removed unnecessary debug logging.
💡 Usage Guide
### Checking Your Pull Request Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later. ### Talking to CodeAnt AI Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask: This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code. ### Retrigger review Ask CodeAnt AI to review the PR again, by typing: ### Check Your Repository Health To analyze the health of your code repository, visit our dashboard at [app.codeant.ai](https://app.codeant.ai). This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.