Skip to content

Commit 008a5a5

Browse files
Update imports
1 parent 8a79159 commit 008a5a5

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

packages/common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/generateLineInfos.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Range } from "../../types/Range";
1+
import type { Range } from "../..";
22

33
/**
44
* Generates a line info for each line in the given range, which includes

packages/common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from "assert";
22
import { map } from "itertools";
3-
import { Range } from "../../types/Range";
3+
import { Range } from "../..";
44
import { BorderStyle } from "../decorationStyle.types";
55
import { handleMultipleLines } from "./handleMultipleLines";
66

packages/common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { flatmap } from "itertools";
2-
import { Range } from "../../types/Range";
2+
import { Range } from "../..";
33
import type { DecorationStyle, StyledRange } from "../decorationStyle.types";
44
import { BorderStyle } from "../decorationStyle.types";
55
import type { LineInfo } from "./generateLineInfos";

packages/cursorless-org-docs/src/docs/components/combineHighlightStyles.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,30 @@ import {
88
import type { BorderRadius, Highlight, Style } from "./types";
99

1010
export function flattenHighlights(highlights: Highlight[]): Highlight[] {
11-
const positions = getUniquePositions(highlights);
11+
const positions = getPositions(highlights);
1212
const results: Highlight[] = [];
1313

1414
for (let i = 0; i < positions.length - 1; i++) {
15-
const subRange: Range = new Range(positions[i], positions[i + 1]);
15+
const range = new Range(positions[i], positions[i + 1]);
1616

1717
const matchingHighlights = highlights.filter(({ range }) =>
18-
range.contains(subRange),
18+
range.contains(range),
1919
);
2020

21-
// This sub range could be between two scopes.
21+
// This sub could be between two scopes.
2222
if (matchingHighlights.length === 0) {
2323
continue;
2424
}
2525

26-
const style = combineHighlightStyles(subRange, matchingHighlights);
26+
const style = combineHighlightStyles(range, matchingHighlights);
2727

28-
results.push({
29-
range: subRange,
30-
style,
31-
});
28+
results.push({ range, style });
3229
}
3330

3431
return results;
3532
}
3633

37-
function getUniquePositions(highlights: Highlight[]): Position[] {
34+
function getPositions(highlights: Highlight[]): Position[] {
3835
const result: Position[] = [];
3936
const emptyHighlights = highlights.filter((h) => h.range.isEmpty);
4037
const positions = highlights

0 commit comments

Comments
 (0)