Skip to content

Commit 0bec633

Browse files
bjaspanBarry Jaspanpre-commit-ci-lite[bot]pokey
authored
Remove more cyclic import dependencies (#2076)
* Changes many imports from index files to direct source. * Removes cycle from notebook.ts and notebookLegacy.ts. * Moves processTargets/targetUtil to processTargets/targets/util so that those files can import from direct source without breaking the barrel boundary. * Moves tryConstructPlainTarget and tryConstructLineTarget to PlainTarget and LineTarget, respectively. The Position/Range/Selection cycle is not touched. There are still some other cycles remaining as well, but this gets a lot of them. --------- Co-authored-by: Barry Jaspan <bjaspan@google.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
1 parent 4a22005 commit 0bec633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+156
-152
lines changed

packages/common/src/util/toPlainObject.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
import type { CharacterRange, GeneralizedRange, LineRange } from "..";
2-
import { FlashStyle, isLineRange } from "..";
1+
import type {
2+
CharacterRange,
3+
GeneralizedRange,
4+
LineRange,
5+
} from "../types/GeneralizedRange";
6+
import { isLineRange } from "../types/GeneralizedRange";
7+
import { FlashStyle } from "../ide/types/FlashDescriptor";
38
import { Token } from "../types/Token";
49
import { Selection } from "../types/Selection";
510

packages/cursorless-engine/src/actions/Actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TreeSitter } from "..";
1+
import { TreeSitter } from "../typings/TreeSitter";
22
import { Snippets } from "../core/Snippets";
33
import { RangeUpdater } from "../core/updateSelections/RangeUpdater";
44
import { ModifierStageFactory } from "../processTargets/ModifierStageFactory";

packages/cursorless-engine/src/actions/ShowParseTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FlashStyle, Range, TextDocument } from "@cursorless/common";
22
import * as path from "node:path";
33
import type { Tree, TreeCursor } from "web-tree-sitter";
4-
import type { TreeSitter } from "..";
4+
import type { TreeSitter } from "../typings/TreeSitter";
55
import { ide } from "../singletons/ide.singleton";
66
import type { Target } from "../typings/target.types";
77
import { flashTargets } from "../util/targetUtils";

packages/cursorless-engine/src/cursorlessEngine.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
IDE,
77
ScopeProvider,
88
} from "@cursorless/common";
9-
import { StoredTargetMap, TreeSitter } from ".";
9+
import { StoredTargetMap } from "./core/StoredTargets";
10+
import { TreeSitter } from "./typings/TreeSitter";
1011
import {
1112
CommandRunnerDecorator,
1213
CursorlessEngine,

packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {
44
Listener,
55
ScopeType,
66
} from "@cursorless/common";
7-
import { SpokenFormGenerator } from ".";
8-
import { CustomSpokenFormGenerator } from "..";
7+
import { SpokenFormGenerator } from "./generateSpokenForm";
8+
import { CustomSpokenFormGenerator } from "../api/CursorlessEngineApi";
99
import { CustomSpokenForms } from "../spokenForms/CustomSpokenForms";
1010
import { TalonSpokenForms } from "../scopeProviders/TalonSpokenForms";
1111

packages/cursorless-engine/src/languages/LanguageDefinitions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from "@cursorless/common";
99
import { join } from "path";
1010
import { SyntaxNode } from "web-tree-sitter";
11-
import { TreeSitter } from "..";
11+
import { TreeSitter } from "../typings/TreeSitter";
1212
import { ide } from "../singletons/ide.singleton";
1313
import { LanguageDefinition } from "./LanguageDefinition";
1414

packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
Modifier,
55
SurroundingPairModifier,
66
} from "@cursorless/common";
7-
import { StoredTargetMap } from "..";
7+
import { StoredTargetMap } from "../core/StoredTargets";
88
import { LanguageDefinitions } from "../languages/LanguageDefinitions";
99
import { ModifierStageFactory } from "./ModifierStageFactory";
1010
import { ModifierStage } from "./PipelineStages.types";

packages/cursorless-engine/src/processTargets/createContinuousRangeTarget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { isSameType } from "../util/typeUtils";
33
import {
44
createContinuousLineRange,
55
createContinuousRange,
6-
} from "./targetUtil/createContinuousRange";
6+
} from "./targets/util/createContinuousRange";
77
import { LineTarget, UntypedTarget } from "./targets";
88

99
/**

packages/cursorless-engine/src/processTargets/marks/TargetMarkStage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TargetPipelineRunner } from "..";
1+
import { TargetPipelineRunner } from "../TargetPipelineRunner";
22
import { TargetMark } from "../../typings/TargetDescriptor";
33
import { Target } from "../../typings/target.types";
44
import { MarkStage } from "../PipelineStages.types";

packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Direction, ScopeType } from "@cursorless/common";
22
import { imap } from "itertools";
3-
import { NestedScopeHandler } from ".";
3+
import { NestedScopeHandler } from "./NestedScopeHandler";
44
import { getMatcher } from "../../../tokenizer";
55
import { generateMatchesInRange } from "../../../util/getMatchesInRange";
66
import { PlainTarget } from "../../targets";

0 commit comments

Comments
 (0)