Open maks-ivanov opened 1 week ago
In the rename
function in lsproxy/src/handlers/rename.rs
(lines 23-50), there is a potential issue with the error handling when locking the manager. The code uses unwrap()
after attempting to lock the manager, which will cause a panic if the lock fails. This could be problematic in a production environment, as it would crash the application instead of gracefully handling the error. Consider using proper error handling instead of unwrap()
.
In the rename_symbol
function in lsproxy/src/lsp/manager.rs
(lines 331-355), the function only supports renaming symbols for Java files. If a user attempts to rename a symbol in a non-Java file, the function will return an UnsupportedFileType
error. This limitation should be clearly documented or communicated to the user to prevent confusion.
Description
RenameRequest
,RenameResponse
, andTextEdit
for handling rename operations.Changes walkthrough
7 files
api_types.rs
Add structs and conversion logic for rename operations
lsproxy/src/api_types.rs
RenameRequest
,RenameResponse
, andTextEdit
forrename operations.
WorkspaceEdit
toRenameResponse
.mod.rs
Integrate rename module into handlers
lsproxy/src/handlers/mod.rs - Integrated the rename module into handlers.
rename.rs
Implement rename handler with HTTP response management
lsproxy/src/handlers/rename.rs
lib.rs
Integrate rename handler and update OpenAPI components
lsproxy/src/lib.rs
client.rs
Add rename method to LSP client
lsproxy/src/lsp/client.rs - Added `text_document_rename` method to the LSP client.
manager.rs
Add rename symbol method with Java restriction
lsproxy/src/lsp/manager.rs
rename_symbol
method to the manager for handling renameoperations.
test.sh
Enhance test script output visibility
scripts/test.sh
--nocapture
for better test outputvisibility.
1 files
run.sh
Support port configuration in run script
scripts/run.sh - Added support for port configuration via environment variable.
1 files
openapi.json
Add rename endpoint and schemas to OpenAPI
openapi.json
💡 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.