Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions playground/ruff/src/Editor/SourceEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,16 @@ class RuffCodeActionProvider implements CodeActionProvider {
): languages.ProviderResult<languages.CodeActionList> {
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
Expand Down
Loading