Conversation
Pull Request Feedback 🔍
|
| let symbol_match = self.get_symbol_match_from_position(file_name, position).await?; | ||
| let references = self.get_references_contained_in_symbol_match(file_name, &symbol_match, full_scan).await?; |
There was a problem hiding this comment.
Suggestion: Consider handling the case where get_symbol_match_from_position or get_references_contained_in_symbol_match might return an error, to provide more context or a specific error message. [best practice]
| let symbol_match = self.get_symbol_match_from_position(file_name, position).await?; | |
| let references = self.get_references_contained_in_symbol_match(file_name, &symbol_match, full_scan).await?; | |
| let symbol_match = self.get_symbol_match_from_position(file_name, position).await.map_err(|e| format!("Error getting symbol match: {}", e))?; | |
| let references = self.get_references_contained_in_symbol_match(file_name, &symbol_match, full_scan).await.map_err(|e| format!("Error getting references: {}", e))?; |
| Self::RecursionLimitExceeded(msg) => HttpResponse::BadRequest().json(ErrorResponse { | ||
| error: format!("Recursion limit exceeded: {}", msg) | ||
| }), |
There was a problem hiding this comment.
Suggestion: Ensure that the RecursionLimitExceeded error is handled consistently with other errors, potentially by logging or monitoring for better traceability. [maintainability]
| Self::RecursionLimitExceeded(msg) => HttpResponse::BadRequest().json(ErrorResponse { | |
| error: format!("Recursion limit exceeded: {}", msg) | |
| }), | |
| Self::RecursionLimitExceeded(msg) => { | |
| log::error!("Recursion limit exceeded: {}", msg); | |
| HttpResponse::BadRequest().json(ErrorResponse { | |
| error: format!("Recursion limit exceeded: {}", msg) | |
| }) | |
| } |
…nition chain resolution
Description
get_symbol_and_referencesto improve the retrieval of symbols and their references.CALLABLE_TYPESfor multiple languages and anis_callablemethod to check if a symbol is callable.RecursionLimitExceeded.once_cellas a dependency to the project.Changes walkthrough
client.rs
Add method for symbol and references retrievallsproxy/src/ast_grep/client.rs
get_symbol_and_referencesfor retrieving symbolsand their references.
types.rs
Add callable types and is_callable methodlsproxy/src/ast_grep/types.rs
CALLABLE_TYPESfor multiple languages.is_callablemethod to check if a symbol is callable.manager.rs
Refactor and enhance definition resolution logiclsproxy/src/lsp/manager/manager.rs
error.rs
Add error handling for recursion limitlsproxy/src/handlers/error.rs
RecursionLimitExceeded.Cargo.toml
Add once_cell dependencylsproxy/Cargo.toml
once_celldependency.💡 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. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.