From 053c750c9383ee166cab41317faeed767ac378bd Mon Sep 17 00:00:00 2001 From: Dan Parizher <105245560+danparizher@users.noreply.github.com> Date: Mon, 29 Sep 2025 03:38:32 -0400 Subject: [PATCH] [`playground`] Fix quick fixes for empty ranges in playground (#20599) Co-authored-by: Micha Reiser --- playground/ruff/src/Editor/SourceEditor.tsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/playground/ruff/src/Editor/SourceEditor.tsx b/playground/ruff/src/Editor/SourceEditor.tsx index eb39a8c063..1dd8b20a64 100644 --- a/playground/ruff/src/Editor/SourceEditor.tsx +++ b/playground/ruff/src/Editor/SourceEditor.tsx @@ -125,17 +125,16 @@ class RuffCodeActionProvider implements CodeActionProvider { ): languages.ProviderResult { const actions = this.diagnostics // Show fixes for any diagnostic whose range intersects the requested range - .filter((check) => - Range.areIntersecting( - new Range( - check.start_location.row, - check.start_location.column, - check.end_location.row, - check.end_location.column, - ), - range, - ), - ) + .filter((check) => { + const diagnosticRange = new Range( + check.start_location.row, + check.start_location.column, + check.end_location.row, + check.end_location.column, + ); + + return Range.areIntersectingOrTouching(diagnosticRange, range); + }) .filter(({ fix }) => fix) .map((check) => ({ title: check.fix