-
-
Notifications
You must be signed in to change notification settings - Fork 739
refactor(oxlint/lsp): prefill FixedContent.message and remove Option wrapper
#16515
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(oxlint/lsp): prefill FixedContent.message and remove Option wrapper
#16515
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
Pull request overview
This PR refactors the linter's fix message handling by removing the Option wrapper from FixedContent.message and prefilling messages earlier in the processing pipeline. The change simplifies code action generation by moving the fallback message logic from fix_content_to_code_action into message_to_lsp_diagnostic, where fix messages are now populated before being converted to FixedContent.
Key changes:
- Changed
FixedContent.messagefromOption<String>toStringand prefill missing messages inmessage_to_lsp_diagnostic - Updated
message_to_lsp_diagnosticto take ownership ofMessageto enable in-place fix modification - Optimized iterator usage by changing
.iter()to.into_iter()when consuming owned collections
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/oxc_language_server/src/linter/server_linter.rs | Removed alternative_message parameter from apply_fix_code_actions call |
| crates/oxc_language_server/src/linter/isolated_lint_handler.rs | Changed .iter() to .into_iter() for owned Vec<Message> collections |
| crates/oxc_language_server/src/linter/error_with_position.rs | Changed FixedContent.message to String, added message prefilling logic, and updated helper functions |
| crates/oxc_language_server/src/linter/code_actions.rs | Simplified by removing alternative message parameter and fallback logic, updated debug assertions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
648a732 to
c82b7b0
Compare
a9c99e4 to
f005b63
Compare
f005b63 to
1372fde
Compare
c82b7b0 to
058e234
Compare
Merge activity
|
058e234 to
316ef44
Compare
…on` wrapper (#16515) > This PR refactors the linter's fix message handling by removing the Option wrapper from FixedContent.message and prefilling messages earlier in the processing pipeline. The change simplifies code action generation by moving the fallback message logic from fix_content_to_code_action into message_to_lsp_diagnostic, where fix messages are now populated before being converted to FixedContent. The goal in the next PR is that the alternative message (from diagnostic) is no longer be stored in memory. So the title should be updated beforehand.
1372fde to
fde0e2e
Compare
…on` wrapper (#16515) > This PR refactors the linter's fix message handling by removing the Option wrapper from FixedContent.message and prefilling messages earlier in the processing pipeline. The change simplifies code action generation by moving the fallback message logic from fix_content_to_code_action into message_to_lsp_diagnostic, where fix messages are now populated before being converted to FixedContent. The goal in the next PR is that the alternative message (from diagnostic) is no longer be stored in memory. So the title should be updated beforehand.
fde0e2e to
e887d24
Compare
…on` wrapper (oxc-project#16515) > This PR refactors the linter's fix message handling by removing the Option wrapper from FixedContent.message and prefilling messages earlier in the processing pipeline. The change simplifies code action generation by moving the fallback message logic from fix_content_to_code_action into message_to_lsp_diagnostic, where fix messages are now populated before being converted to FixedContent. The goal in the next PR is that the alternative message (from diagnostic) is no longer be stored in memory. So the title should be updated beforehand.

The goal in the next PR is that the alternative message (from diagnostic) is no longer be stored in memory. So the title should be updated beforehand.