chore(oxc_linter): move Message::from_tsgo_lint_diagnostic behind the language_server feature flag#13374
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.
Pull Request Overview
This PR fixes a dead code warning by placing the Message::from_tsgo_lint_diagnostic method behind the language_server feature flag. The method was only used in language server contexts but wasn't conditionally compiled, causing a warning when building without that feature.
- Moved imports for
Message,PossibleFixes, and language server types behind the feature flag - Added
#[cfg(feature = "language_server")]attribute to theMessageimplementation
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13374 will degrade performances by 11.94%Comparing Summary
Benchmarks breakdown
Footnotes |
Merge activity
|
…he language_server feature flag (#13374) fixes the warning when running the command: ``` ~/dev/oxc$ cargo test -p oxlint warning: associated function `from_tsgo_lint_diagnostic` is never used --> crates/oxc_linter/src/tsgolint.rs:569:8 | 567 | impl Message<'_> { | ---------------- associated function in this implementation 568 | /// Converts a `TsGoLintDiagnostic` into a `Message` with possible fixes. 569 | fn from_tsgo_lint_diagnostic(val: TsGoLintDiagnostic, source_text: &str) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ```
d5f316a to
100f9cc
Compare

fixes the warning when running the command: