Skip to content

refactor(oxlint/lsp): check for FixedContentKind instead of guessing logic#19795

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-26-refactor_oxlint_lsp_check_for_fixedcontentkind_instead_of_guessing_logic
Feb 27, 2026
Merged

refactor(oxlint/lsp): check for FixedContentKind instead of guessing logic#19795
graphite-app[bot] merged 1 commit intomainfrom
02-26-refactor_oxlint_lsp_check_for_fixedcontentkind_instead_of_guessing_logic

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Feb 26, 2026

This PR refactors the fix_all_text_edit function in the LSP code actions module to use explicit type checking via FixedContentKind instead of relying on heuristics based on the length of the fixes array. This makes the code more maintainable and aligns it with the pattern already used in the apply_fix_code_actions function.

Copy link
Member Author

Sysix commented Feb 26, 2026


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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Feb 26, 2026
@Sysix Sysix requested a review from Copilot February 26, 2026 20:54
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 fix_all_text_edit function in the LSP code actions module to use explicit type checking via FixedContentKind instead of relying on heuristics based on the length of the fixes array. This makes the code more maintainable and aligns it with the pattern already used in the apply_fix_code_actions function.

Changes:

  • Replaced fragile length-based heuristic with explicit FixedContentKind enum checking
  • Removed debug assertions that are no longer needed
  • Used .find() to locate the first real fix (LintRule or UnusedDirective) instead of .next().unwrap()

@Sysix Sysix marked this pull request as ready for review February 27, 2026 16:36
@Sysix Sysix requested a review from camc314 as a code owner February 27, 2026 16:36
@Sysix Sysix added 0-merge Merge with Graphite Merge Queue labels Feb 27, 2026
Copy link
Member Author

Sysix commented Feb 27, 2026

Merge activity

…g logic (#19795)

> This PR refactors the `fix_all_text_edit` function in the LSP code actions module to use explicit type checking via `FixedContentKind` instead of relying on heuristics based on the length of the fixes array. This makes the code more maintainable and aligns it with the pattern already used in the `apply_fix_code_actions` function.
@graphite-app graphite-app bot force-pushed the 02-26-refactor_oxlint_lsp_check_for_fixedcontentkind_instead_of_guessing_logic branch from d8a6524 to a45b9f4 Compare February 27, 2026 16:38
@graphite-app graphite-app bot merged commit a45b9f4 into main Feb 27, 2026
19 checks passed
@graphite-app graphite-app bot deleted the 02-26-refactor_oxlint_lsp_check_for_fixedcontentkind_instead_of_guessing_logic branch February 27, 2026 16:45
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI 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.

2 participants