Skip to content

fix(lsp): consolidate range_overlaps into shared utils#3

Merged
wagenet merged 4 commits intofix-autofixfrom
copilot/fix-issues-from-pr-19793
Feb 27, 2026
Merged

fix(lsp): consolidate range_overlaps into shared utils#3
wagenet merged 4 commits intofix-autofixfrom
copilot/fix-issues-from-pr-19793

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 27, 2026

range_overlaps was defined locally in server_linter.rs while code_actions.rs had an equivalent inline check. This consolidates both into a single shared pub(super) fn range_overlaps in utils.rs.

Changes

  • utils.rs: Added pub(super) fn range_overlaps(a: Range, b: Range) -> bool (non-strict <=/>=, so touching ranges are treated as overlapping)
  • server_linter.rs: Removed local definition; imports from utils
  • code_actions.rs: Replaced 4-line inline check with range_overlaps; collapsed nested if let/if into a let-chain to satisfy clippy::collapsible_if

The fix_all_text_edit behavior changes slightly: adjacent edits sharing a boundary point are now conservatively dropped (previously kept). This is safe — the deferred fix applies on the next "fix all" invocation.


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

Co-authored-by: wagenet <9835+wagenet@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues called out in PR #19793 fix(lsp): add unit tests for fix_all_text_edit overlap detection Feb 27, 2026
@autofix-troubleshooter
Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

Co-authored-by: wagenet <9835+wagenet@users.noreply.github.com>
Copilot AI changed the title fix(lsp): add unit tests for fix_all_text_edit overlap detection fix(lsp): reuse shared range_overlaps utility in fix_all_text_edit Feb 27, 2026
Co-authored-by: wagenet <9835+wagenet@users.noreply.github.com>
Copilot AI changed the title fix(lsp): reuse shared range_overlaps utility in fix_all_text_edit fix(lsp): consolidate range_overlaps into shared utils Feb 27, 2026
@wagenet wagenet marked this pull request as ready for review February 27, 2026 20:07
@wagenet wagenet merged commit f14be42 into fix-autofix Feb 27, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants