Skip to content

refactor(language_server): do not check twice for supported extension#13130

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-15-refactor_language_server_do_not_check_twice_for_supported_extension
Aug 15, 2025
Merged

refactor(language_server): do not check twice for supported extension#13130
graphite-app[bot] merged 1 commit intomainfrom
08-15-refactor_language_server_do_not_check_twice_for_supported_extension

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Aug 15, 2025

should_lint_path does the same as Loader::can_load but with a OnceLock

@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 Aug 15, 2025
Copy link
Member Author

Sysix commented Aug 15, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 15, 2025

CodSpeed Instrumentation Performance Report

Merging #13130 will not alter performance

Comparing 08-15-refactor_language_server_do_not_check_twice_for_supported_extension (b638371) with main (34ae2f0)1

Summary

✅ 34 untouched benchmarks

Footnotes

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

@Sysix Sysix changed the base branch from 08-15-refactor_linter_pass_cwd_instead_of_lintserviceoptions_ to graphite-base/13130 August 15, 2025 18:47
@Sysix Sysix force-pushed the 08-15-refactor_language_server_do_not_check_twice_for_supported_extension branch from 0efe47f to 0fbe95b Compare August 15, 2025 18:47
@Sysix Sysix force-pushed the graphite-base/13130 branch from e065911 to 83d25ce Compare August 15, 2025 18:47
@Sysix Sysix changed the base branch from graphite-base/13130 to main August 15, 2025 18:48
@Sysix Sysix force-pushed the 08-15-refactor_language_server_do_not_check_twice_for_supported_extension branch 2 times, most recently from d3f7417 to bb93a4b Compare August 15, 2025 19:48
@Sysix Sysix marked this pull request as ready for review August 15, 2025 20:23
Copilot AI review requested due to automatic review settings August 15, 2025 20:23
@Sysix Sysix requested a review from camc314 as a code owner August 15, 2025 20:23
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 pull request refactors the language server to eliminate duplicate checks for supported file extensions. The change removes the use of Loader::can_load in favor of the existing should_lint_path function that uses a OnceLock for caching.

  • Removes duplicate extension checking logic by consolidating to should_lint_path
  • Simplifies the lint_path method by removing optional return types and pre-validation
  • Comments out a flaky multi-folder test in the VS Code extension

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/oxc_language_server/src/linter/isolated_lint_handler.rs Refactors linting logic to use should_lint_path instead of Loader::can_load and simplifies method signatures
editors/vscode/tests/e2e_server.spec.ts Comments out flaky multi-folder test and removes unused imports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Aug 15, 2025
Copy link
Contributor

camc314 commented Aug 15, 2025

Merge activity

…#13130)

`should_lint_path` does the same as `Loader::can_load` but with a `OnceLock`
@graphite-app graphite-app bot force-pushed the 08-15-refactor_language_server_do_not_check_twice_for_supported_extension branch from bb93a4b to b638371 Compare August 15, 2025 22:19
@graphite-app graphite-app bot merged commit b638371 into main Aug 15, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 08-15-refactor_language_server_do_not_check_twice_for_supported_extension branch August 15, 2025 22:23
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server 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