-
Notifications
You must be signed in to change notification settings - Fork 10
Make Range optional in read source code endpoint #125
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
Conversation
This commit introduces a more structured approach to representing file ranges by adding a nested `Range` type to `FileRange`. The changes include: Make range optional for read source code
Pull Request Feedback 🔍
|
| character: 0, | ||
| }, | ||
| end: Position { | ||
| line: definition.range.end.line as u32 + 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Consider using saturating_add instead of + 3 to prevent potential overflow when calculating the end line position. [possible issue]
| line: definition.range.end.line as u32 + 3, | |
| line: definition.range.end.line.saturating_add(3), |
|
|
||
| let expected = vec![ | ||
| Location { | ||
| uri: Url::parse("file:///mnt/lsproxy_root/sample_project/java/AStar.java").unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Validate that the Url::parse method is used correctly to handle potential errors gracefully. [best practice]
| uri: Url::parse("file:///mnt/lsproxy_root/sample_project/java/AStar.java").unwrap(), | |
| uri: Url::parse("file:///mnt/lsproxy_root/sample_project/java/AStar.java").expect("Failed to parse URL"), |
…ures This commit updates the OpenAPI schema to consistently use the new `Range` and `FileRange` types across multiple schemas. Key changes include: - Renaming `range` to `file_range` in symbol and definition schemas - Adding a new `ReadSourceCodeRequest` schema with optional range - Modifying `FileRange` to use nested `Range` type - Adjusting request and response schemas to reflect these structural changes
robmck1995
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
User description
This commit introduces a more structured approach to representing file ranges by adding a nested
Rangetype toFileRange. The changes include:Make range optional for read source code
#64
CodeAnt-AI Description
FileRangestructure to include a nestedRangetype, enhancing the code's modularity and readability.file_rangestructure, ensuring compatibility and correctness.api_types::Rangeandlsp_types::Rangewhere appropriate.Changes walkthrough
python_tests.rs
Refactor Python tests to use nested `Range` type in `FileRange`lsproxy/src/lsp/manager/language_tests/python_tests.rs
api_types::Rangeas a nested type withinFileRange.file_rangeinstead ofrange.api_types.js_tests.rs
Update JS tests to use consistent `Range` typelsproxy/src/lsp/manager/language_tests/js_tests.rs
Rangetolsp_types::Rangefor consistency.file_rangeinstead ofrange.PositionandRangefromapi_types.💡 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.