refactor(language_server): do not check twice for supported extension#13130
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. |
CodSpeed Instrumentation Performance ReportMerging #13130 will not alter performanceComparing Summary
Footnotes |
0efe47f to
0fbe95b
Compare
e065911 to
83d25ce
Compare
d3f7417 to
bb93a4b
Compare
There was a problem hiding this comment.
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_pathmethod 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.
Merge activity
|
…#13130) `should_lint_path` does the same as `Loader::can_load` but with a `OnceLock`
bb93a4b to
b638371
Compare

should_lint_pathdoes the same asLoader::can_loadbut with aOnceLock