Skip to content

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Oct 30, 2025

Because tsgolint works now on type, the Backend can now be responsible to skip the linting part.
This simplifies a lot :)

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Oct 30, 2025
Copy link
Member Author

Sysix commented Oct 30, 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Sysix Sysix changed the title refactor(language_server): Backend chekcs the correct LintOptions::Run refactor(language_server): Backend checks the correct LintOptions::Run Oct 30, 2025
@Sysix Sysix changed the base branch from 10-10-refactor_language_server_use_lintrunner_ to graphite-base/15166 October 30, 2025 21:31
@Sysix Sysix force-pushed the 10-30-refactor_language_server_backend_chekcs_the_correct_lintoptions_run_ branch from f05f4ab to f211d1e Compare October 30, 2025 21:41
@Sysix Sysix force-pushed the graphite-base/15166 branch from 716cfc9 to 27c0255 Compare October 30, 2025 21:41
@Sysix Sysix requested a review from Copilot October 31, 2025 00:22
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 linter run behavior in the language server by removing the ServerLinterRun enum and moving the run type checking from the linter layer to the backend layer. The main purpose is to simplify the linter API and improve separation of concerns.

Key changes:

  • Removed ServerLinterRun enum and its matching logic from ServerLinter
  • Added should_lint_on_run_type method to WorkspaceWorker for run type validation
  • Updated backend handlers (did_save, did_change) to check run type before linting
  • Removed test fixtures and tests related to run type filtering
  • Simplified lint_file method signature by removing the run_type parameter

Reviewed Changes

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

Show a summary per file
File Description
crates/oxc_language_server/src/worker.rs Added should_lint_on_run_type method and removed run_type parameter from lint_file
crates/oxc_language_server/src/backend.rs Added run type checks in did_save and did_change handlers before calling lint_file
crates/oxc_language_server/src/linter/server_linter.rs Removed ServerLinterRun enum, removed run type matching logic from run_single, and removed related tests
crates/oxc_language_server/src/tester.rs Simplified test methods by removing run type parameters
crates/oxc_language_server/src/snapshots/*.snap Deleted snapshot files for removed run type tests
crates/oxc_language_server/fixtures/linter/lint_on_run/**/*.ts Deleted test fixture files for run type functionality

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

@Sysix Sysix marked this pull request as ready for review October 31, 2025 10:17
@Sysix Sysix requested a review from camc314 as a code owner October 31, 2025 10:17
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Nov 3, 2025
Copy link
Contributor

camc314 commented Nov 3, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Nov 3, 2025
…:Run` (#15166)

Because `tsgolint` works now on type, the `Backend` can now be responsible to skip the linting part.
This simplifies a lot :)
@graphite-app graphite-app bot force-pushed the 10-30-refactor_language_server_backend_chekcs_the_correct_lintoptions_run_ branch from f211d1e to d8a2f85 Compare November 3, 2025 14:03
@github-actions github-actions bot added A-linter Area - Linter A-parser Area - Parser A-semantic Area - Semantic A-cli Area - CLI A-minifier Area - Minifier A-ast Area - AST A-transformer Area - Transformer / Transpiler labels Nov 3, 2025
@github-actions github-actions bot added A-isolated-declarations Isolated Declarations A-ast-tools Area - AST tools A-formatter Area - Formatter labels Nov 3, 2025
@graphite-app graphite-app bot changed the base branch from graphite-base/15166 to 10-10-refactor_language_server_use_lintrunner_ November 3, 2025 14:04
Base automatically changed from 10-10-refactor_language_server_use_lintrunner_ to main November 3, 2025 14:07
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 3, 2025
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Nov 3, 2025
@Sysix Sysix force-pushed the 10-30-refactor_language_server_backend_chekcs_the_correct_lintoptions_run_ branch from d8a2f85 to 4a2477b Compare November 3, 2025 18:05
…:Run` (#15166)

Because `tsgolint` works now on type, the `Backend` can now be responsible to skip the linting part.
This simplifies a lot :)
@graphite-app graphite-app bot force-pushed the 10-30-refactor_language_server_backend_chekcs_the_correct_lintoptions_run_ branch from 4a2477b to 10732e8 Compare November 3, 2025 18:10
@graphite-app graphite-app bot merged commit 10732e8 into main Nov 3, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 10-30-refactor_language_server_backend_chekcs_the_correct_lintoptions_run_ branch November 3, 2025 18:14
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 3, 2025
@Boshen Boshen mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools A-cli Area - CLI A-editor Area - Editor and Language Server A-formatter Area - Formatter A-isolated-declarations Isolated Declarations A-linter Area - Linter A-minifier Area - Minifier A-parser Area - Parser A-semantic Area - Semantic A-transformer Area - Transformer / Transpiler 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.

3 participants