diff --git a/.eslintrc.json b/.eslintrc.json index 54fc05744..582a62888 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,6 +23,7 @@ ], "rules": { "import/no-relative-packages": "error", + "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/consistent-type-assertions": [ "error", { diff --git a/packages/cheatsheet-local/src/app/app.tsx b/packages/cheatsheet-local/src/app/app.tsx index bf330971b..c7d5d4a2b 100644 --- a/packages/cheatsheet-local/src/app/app.tsx +++ b/packages/cheatsheet-local/src/app/app.tsx @@ -1,4 +1,5 @@ -import { CheatsheetPage, CheatsheetInfo } from "@cursorless/cheatsheet"; +import type { CheatsheetInfo } from "@cursorless/cheatsheet"; +import { CheatsheetPage } from "@cursorless/cheatsheet"; import "../styles.css"; declare global { diff --git a/packages/cheatsheet/src/lib/cheatsheet.tsx b/packages/cheatsheet/src/lib/cheatsheet.tsx index d484c45d5..cda80f4d9 100644 --- a/packages/cheatsheet/src/lib/cheatsheet.tsx +++ b/packages/cheatsheet/src/lib/cheatsheet.tsx @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCircleQuestion } from "@fortawesome/free-solid-svg-icons/faCircleQuestion"; import CheatsheetNotesComponent from "./components/CheatsheetNotesComponent"; import SmartLink from "./components/SmartLink"; -import { CheatsheetInfo } from "./CheatsheetInfo"; +import type { CheatsheetInfo } from "./CheatsheetInfo"; type CheatsheetPageProps = { cheatsheetInfo: CheatsheetInfo; diff --git a/packages/cheatsheet/src/lib/components/CheatsheetLegendComponent.tsx b/packages/cheatsheet/src/lib/components/CheatsheetLegendComponent.tsx index 370903145..c48f3c765 100644 --- a/packages/cheatsheet/src/lib/components/CheatsheetLegendComponent.tsx +++ b/packages/cheatsheet/src/lib/components/CheatsheetLegendComponent.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { CheatsheetLegend } from "../cheatsheetLegend"; +import type { CheatsheetLegend } from "../cheatsheetLegend"; import useIsHighlighted from "../hooks/useIsHighlighted"; import { formatCaptures } from "./formatCaptures"; import SmartLink from "./SmartLink"; diff --git a/packages/cheatsheet/src/lib/components/CheatsheetListComponent.tsx b/packages/cheatsheet/src/lib/components/CheatsheetListComponent.tsx index db7c8beff..e51458691 100644 --- a/packages/cheatsheet/src/lib/components/CheatsheetListComponent.tsx +++ b/packages/cheatsheet/src/lib/components/CheatsheetListComponent.tsx @@ -1,4 +1,4 @@ -import { CheatsheetSection, Variation } from "../CheatsheetInfo"; +import type { CheatsheetSection, Variation } from "../CheatsheetInfo"; import useIsHighlighted from "../hooks/useIsHighlighted"; import { formatCaptures } from "./formatCaptures"; diff --git a/packages/common/src/FakeCommandServerApi.ts b/packages/common/src/FakeCommandServerApi.ts index 8ea7b9100..46d555948 100644 --- a/packages/common/src/FakeCommandServerApi.ts +++ b/packages/common/src/FakeCommandServerApi.ts @@ -1,4 +1,4 @@ -import { +import type { CommandServerApi, FocusedElementType, InboundSignal, diff --git a/packages/common/src/ide/fake/FakeCapabilities.ts b/packages/common/src/ide/fake/FakeCapabilities.ts index d45d4f1dd..a295ee864 100644 --- a/packages/common/src/ide/fake/FakeCapabilities.ts +++ b/packages/common/src/ide/fake/FakeCapabilities.ts @@ -1,4 +1,4 @@ -import { Capabilities } from "../types/Capabilities"; +import type { Capabilities } from "../types/Capabilities"; export class FakeCapabilities implements Capabilities { commands = { diff --git a/packages/common/src/ide/fake/FakeConfiguration.ts b/packages/common/src/ide/fake/FakeConfiguration.ts index 07f97c27b..0638b8c6b 100644 --- a/packages/common/src/ide/fake/FakeConfiguration.ts +++ b/packages/common/src/ide/fake/FakeConfiguration.ts @@ -1,13 +1,13 @@ import { get } from "lodash-es"; import { Notifier } from "../../util/Notifier"; -import { +import type { Configuration, ConfigurationScope, - CONFIGURATION_DEFAULTS, CursorlessConfigKey, CursorlessConfiguration, } from "../types/Configuration"; -import { GetFieldType, Paths } from "../types/Paths"; +import { CONFIGURATION_DEFAULTS } from "../types/Configuration"; +import type { GetFieldType, Paths } from "../types/Paths"; interface ConfigurationScopeValues { scope: ConfigurationScope; diff --git a/packages/common/src/ide/fake/FakeIDE.ts b/packages/common/src/ide/fake/FakeIDE.ts index 27e453ff3..aff28b88e 100644 --- a/packages/common/src/ide/fake/FakeIDE.ts +++ b/packages/common/src/ide/fake/FakeIDE.ts @@ -1,11 +1,11 @@ import { pull } from "lodash-es"; import type { EditableTextEditor, TextEditor } from "../.."; -import { GeneralizedRange } from "../../types/GeneralizedRange"; -import { TextDocument } from "../../types/TextDocument"; +import type { GeneralizedRange } from "../../types/GeneralizedRange"; +import type { TextDocument } from "../../types/TextDocument"; import type { TextDocumentChangeEvent } from "../types/Events"; -import { FlashDescriptor } from "../types/FlashDescriptor"; -import { QuickPickOptions } from "../types/QuickPickOptions"; -import { +import type { FlashDescriptor } from "../types/FlashDescriptor"; +import type { QuickPickOptions } from "../types/QuickPickOptions"; +import type { Event, TextEditorSelectionChangeEvent, TextEditorVisibleRangesChangeEvent, diff --git a/packages/common/src/ide/normalized/NormalizedIDE.ts b/packages/common/src/ide/normalized/NormalizedIDE.ts index 20222aa5a..0813e7e5a 100644 --- a/packages/common/src/ide/normalized/NormalizedIDE.ts +++ b/packages/common/src/ide/normalized/NormalizedIDE.ts @@ -1,12 +1,12 @@ -import { GeneralizedRange } from "../../types/GeneralizedRange"; -import { TextEditor } from "../../types/TextEditor"; -import FakeConfiguration from "../fake/FakeConfiguration"; -import FakeKeyValueStore from "../fake/FakeKeyValueStore"; -import { FakeIDE } from "../fake/FakeIDE"; +import type { GeneralizedRange } from "../../types/GeneralizedRange"; +import type { TextEditor } from "../../types/TextEditor"; +import type FakeConfiguration from "../fake/FakeConfiguration"; +import type FakeKeyValueStore from "../fake/FakeKeyValueStore"; +import type { FakeIDE } from "../fake/FakeIDE"; import PassthroughIDEBase from "../PassthroughIDEBase"; -import { FlashDescriptor } from "../types/FlashDescriptor"; +import type { FlashDescriptor } from "../types/FlashDescriptor"; import type { IDE } from "../types/ide.types"; -import { QuickPickOptions } from "../types/QuickPickOptions"; +import type { QuickPickOptions } from "../types/QuickPickOptions"; export class NormalizedIDE extends PassthroughIDEBase { configuration: FakeConfiguration; diff --git a/packages/common/src/ide/spy/SpyIDE.ts b/packages/common/src/ide/spy/SpyIDE.ts index b7bf106a2..88326c1d2 100644 --- a/packages/common/src/ide/spy/SpyIDE.ts +++ b/packages/common/src/ide/spy/SpyIDE.ts @@ -1,10 +1,11 @@ import { pickBy, values } from "lodash-es"; -import { GeneralizedRange } from "../../types/GeneralizedRange"; -import { TextEditor } from "../../types/TextEditor"; +import type { GeneralizedRange } from "../../types/GeneralizedRange"; +import type { TextEditor } from "../../types/TextEditor"; import PassthroughIDEBase from "../PassthroughIDEBase"; -import { FlashDescriptor } from "../types/FlashDescriptor"; +import type { FlashDescriptor } from "../types/FlashDescriptor"; import type { HighlightId, IDE } from "../types/ide.types"; -import SpyMessages, { Message } from "./SpyMessages"; +import type { Message } from "./SpyMessages"; +import SpyMessages from "./SpyMessages"; interface Highlight { highlightId: HighlightId | undefined; diff --git a/packages/common/src/ide/types/Capabilities.ts b/packages/common/src/ide/types/Capabilities.ts index 08226f7fe..c21ba7068 100644 --- a/packages/common/src/ide/types/Capabilities.ts +++ b/packages/common/src/ide/types/Capabilities.ts @@ -1,4 +1,4 @@ -import { CommandId } from "./CommandId"; +import type { CommandId } from "./CommandId"; export interface Capabilities { /** diff --git a/packages/common/src/ide/types/Configuration.ts b/packages/common/src/ide/types/Configuration.ts index 2b427f1f5..10c0ad8c4 100644 --- a/packages/common/src/ide/types/Configuration.ts +++ b/packages/common/src/ide/types/Configuration.ts @@ -1,7 +1,7 @@ -import { Listener } from "../.."; +import type { Listener } from "../.."; import { HatStability } from "./HatStability"; -import { Disposable } from "./ide.types"; -import { GetFieldType, Paths } from "./Paths"; +import type { Disposable } from "./ide.types"; +import type { GetFieldType, Paths } from "./Paths"; export type CursorlessConfiguration = { tokenHatSplittingMode: TokenHatSplittingMode; diff --git a/packages/common/src/ide/types/FileSystem.types.ts b/packages/common/src/ide/types/FileSystem.types.ts index 8990f371d..e867bb0df 100644 --- a/packages/common/src/ide/types/FileSystem.types.ts +++ b/packages/common/src/ide/types/FileSystem.types.ts @@ -1,4 +1,4 @@ -import { Disposable } from "./ide.types"; +import type { Disposable } from "./ide.types"; export type PathChangeListener = () => void; diff --git a/packages/common/src/ide/types/FlashDescriptor.ts b/packages/common/src/ide/types/FlashDescriptor.ts index 9694dcb90..db9613b58 100644 --- a/packages/common/src/ide/types/FlashDescriptor.ts +++ b/packages/common/src/ide/types/FlashDescriptor.ts @@ -1,5 +1,5 @@ -import { TextEditor } from "../.."; -import { GeneralizedRange } from "../../types/GeneralizedRange"; +import type { TextEditor } from "../.."; +import type { GeneralizedRange } from "../../types/GeneralizedRange"; export enum FlashStyle { pendingDelete = "pendingDelete", diff --git a/packages/common/src/ide/types/Hats.ts b/packages/common/src/ide/types/Hats.ts index ce7bf5cc4..72cf1f7de 100644 --- a/packages/common/src/ide/types/Hats.ts +++ b/packages/common/src/ide/types/Hats.ts @@ -1,8 +1,8 @@ -import { Range } from "../../types/Range"; -import { TextEditor } from "../../types/TextEditor"; -import { Listener } from "../../util/Notifier"; +import type { Range } from "../../types/Range"; +import type { TextEditor } from "../../types/TextEditor"; +import type { Listener } from "../../util/Notifier"; import type { HatStyleName } from "./hatStyles.types"; -import { Disposable } from "./ide.types"; +import type { Disposable } from "./ide.types"; export interface HatRange { styleName: HatStyleName; diff --git a/packages/common/src/ide/types/KeyValueStore.ts b/packages/common/src/ide/types/KeyValueStore.ts index 5108628bc..8b432f048 100644 --- a/packages/common/src/ide/types/KeyValueStore.ts +++ b/packages/common/src/ide/types/KeyValueStore.ts @@ -1,4 +1,4 @@ -import { TutorialId } from "../../types/tutorial.types"; +import type { TutorialId } from "../../types/tutorial.types"; interface SingleTutorialProgress { currentStep: number; diff --git a/packages/common/src/ide/types/RawTreeSitterQueryProvider.ts b/packages/common/src/ide/types/RawTreeSitterQueryProvider.ts index f5d797fa3..ca69e60f9 100644 --- a/packages/common/src/ide/types/RawTreeSitterQueryProvider.ts +++ b/packages/common/src/ide/types/RawTreeSitterQueryProvider.ts @@ -1,4 +1,4 @@ -import { Disposable } from "@cursorless/common"; +import type { Disposable } from "@cursorless/common"; /** * Provides raw tree-sitter queries. These are usually read from `.scm` files diff --git a/packages/common/src/ide/types/TutorialContentProvider.ts b/packages/common/src/ide/types/TutorialContentProvider.ts index 80852b64b..df3304b5f 100644 --- a/packages/common/src/ide/types/TutorialContentProvider.ts +++ b/packages/common/src/ide/types/TutorialContentProvider.ts @@ -1,5 +1,5 @@ -import { TestCaseFixtureLegacy } from "../../types/TestCaseFixture"; -import { TutorialId } from "../../types/tutorial.types"; +import type { TestCaseFixtureLegacy } from "../../types/TestCaseFixture"; +import type { TutorialId } from "../../types/tutorial.types"; export interface TutorialContentProvider { /** diff --git a/packages/common/src/ide/types/ide.types.ts b/packages/common/src/ide/types/ide.types.ts index 4031128b2..44ad8562a 100644 --- a/packages/common/src/ide/types/ide.types.ts +++ b/packages/common/src/ide/types/ide.types.ts @@ -4,21 +4,21 @@ import type { TextDocument, TextEditor, } from "../.."; -import { URI } from "vscode-uri"; -import { GeneralizedRange } from "../../types/GeneralizedRange"; -import { Capabilities } from "./Capabilities"; -import { Clipboard } from "./Clipboard"; -import { Configuration } from "./Configuration"; -import { TextDocumentChangeEvent } from "./Events"; -import { +import type { URI } from "vscode-uri"; +import type { GeneralizedRange } from "../../types/GeneralizedRange"; +import type { Capabilities } from "./Capabilities"; +import type { Clipboard } from "./Clipboard"; +import type { Configuration } from "./Configuration"; +import type { TextDocumentChangeEvent } from "./Events"; +import type { Event, TextEditorSelectionChangeEvent, TextEditorVisibleRangesChangeEvent, } from "./events.types"; -import { FlashDescriptor } from "./FlashDescriptor"; -import { Messages } from "./Messages"; -import { QuickPickOptions } from "./QuickPickOptions"; -import { KeyValueStore } from "./KeyValueStore"; +import type { FlashDescriptor } from "./FlashDescriptor"; +import type { Messages } from "./Messages"; +import type { QuickPickOptions } from "./QuickPickOptions"; +import type { KeyValueStore } from "./KeyValueStore"; export type RunMode = "production" | "development" | "test"; export type HighlightId = string; diff --git a/packages/common/src/ide/util/messages.ts b/packages/common/src/ide/util/messages.ts index 85ffce897..26565eb9b 100644 --- a/packages/common/src/ide/util/messages.ts +++ b/packages/common/src/ide/util/messages.ts @@ -1,4 +1,5 @@ -import { MessageId, Messages, MessageType } from "../types/Messages"; +import type { MessageId, Messages } from "../types/Messages"; +import { MessageType } from "../types/Messages"; /** * Displays a warning message {@link message} to the user along with possible diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index f8ddbcae2..d12a0f424 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/clojure.ts b/packages/common/src/scopeSupportFacets/clojure.ts index 54b18b80d..3853f1358 100644 --- a/packages/common/src/scopeSupportFacets/clojure.ts +++ b/packages/common/src/scopeSupportFacets/clojure.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 02ff74702..7954a53a8 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -1,8 +1,6 @@ import { cScopeSupport } from "./c"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 5fa06209d..3461d7cf0 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 6c95a254d..4e29dc153 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index d36539280..d09a610fd 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 583fe800d..9380d9100 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index db0ba21a8..f6b27eeb7 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 829335a03..232650fd0 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/javascriptreact.ts b/packages/common/src/scopeSupportFacets/javascriptreact.ts index 7ea99f3b5..f11e9db3d 100644 --- a/packages/common/src/scopeSupportFacets/javascriptreact.ts +++ b/packages/common/src/scopeSupportFacets/javascriptreact.ts @@ -1,8 +1,6 @@ import { javascriptScopeSupport } from "./javascript"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 6e0352d40..1e7efd0e5 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/jsonc.ts b/packages/common/src/scopeSupportFacets/jsonc.ts index 73025cb83..b67e38379 100644 --- a/packages/common/src/scopeSupportFacets/jsonc.ts +++ b/packages/common/src/scopeSupportFacets/jsonc.ts @@ -1,8 +1,6 @@ import { jsonScopeSupport } from "./json"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/jsonl.ts b/packages/common/src/scopeSupportFacets/jsonl.ts index 893ac0e9a..f098d5cdf 100644 --- a/packages/common/src/scopeSupportFacets/jsonl.ts +++ b/packages/common/src/scopeSupportFacets/jsonl.ts @@ -1,8 +1,6 @@ import { jsonScopeSupport } from "./json"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts index 2d450c9a2..8e9d706b5 100644 --- a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts +++ b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts @@ -20,7 +20,7 @@ import { rubyScopeSupport } from "./ruby"; import { rustScopeSupport } from "./rust"; import { scalaScopeSupport } from "./scala"; import { scmScopeSupport } from "./scm"; -import { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { scssScopeSupport } from "./scss"; import { talonScopeSupport } from "./talon"; import { typescriptScopeSupport } from "./typescript"; diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index 63777c60b..db73bc677 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index 8d9271d90..5b515b1af 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index c75edb1d6..7831a7c03 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index 64dd4bdf1..e47bb1cd1 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 8c9d934d9..7fdac4b43 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/ruby.ts b/packages/common/src/scopeSupportFacets/ruby.ts index 581e7486c..93670e3aa 100644 --- a/packages/common/src/scopeSupportFacets/ruby.ts +++ b/packages/common/src/scopeSupportFacets/ruby.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index d7fc91ed8..125b6a5dd 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 916d5bb3d..47919c98e 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index e860275f3..5148616fa 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 21979eeeb..8ac41be38 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -1,4 +1,4 @@ -import { +import type { ScopeSupportFacet, ScopeSupportFacetInfo, } from "./scopeSupportFacets.types"; diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 850f71976..2112a74ad 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -1,7 +1,5 @@ -import { - SimpleScopeTypeType, - type ScopeType, -} from "../types/command/PartialTargetDescriptor.types"; +import type { SimpleScopeTypeType } from "../types/command/PartialTargetDescriptor.types"; +import { type ScopeType } from "../types/command/PartialTargetDescriptor.types"; export const scopeSupportFacets = [ "command", diff --git a/packages/common/src/scopeSupportFacets/scss.ts b/packages/common/src/scopeSupportFacets/scss.ts index 457aec651..e5e00175a 100644 --- a/packages/common/src/scopeSupportFacets/scss.ts +++ b/packages/common/src/scopeSupportFacets/scss.ts @@ -1,8 +1,6 @@ import { cssScopeSupport } from "./css"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 0819023fa..6b64079b1 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/textualScopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/textualScopeSupportFacetInfos.ts index a03ae3a75..eb933a887 100644 --- a/packages/common/src/scopeSupportFacets/textualScopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/textualScopeSupportFacetInfos.ts @@ -1,4 +1,4 @@ -import { +import type { ScopeSupportFacetInfo, TextualScopeSupportFacet, } from "./scopeSupportFacets.types"; diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 86faebae7..a5e852116 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -1,8 +1,6 @@ import { javascriptCoreScopeSupport } from "./javascript"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/typescriptreact.ts b/packages/common/src/scopeSupportFacets/typescriptreact.ts index 6b87673b5..017870775 100644 --- a/packages/common/src/scopeSupportFacets/typescriptreact.ts +++ b/packages/common/src/scopeSupportFacets/typescriptreact.ts @@ -1,8 +1,6 @@ import { javascriptJsxScopeSupport } from "./javascript"; -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; import { typescriptScopeSupport } from "./typescript"; // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index a28afed49..70bc4cdc2 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 01f9be0e5..f81868669 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -1,7 +1,5 @@ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; diff --git a/packages/common/src/testUtil/TestCaseSnapshot.ts b/packages/common/src/testUtil/TestCaseSnapshot.ts index cb8690914..07ea13424 100644 --- a/packages/common/src/testUtil/TestCaseSnapshot.ts +++ b/packages/common/src/testUtil/TestCaseSnapshot.ts @@ -1,5 +1,5 @@ -import { StoredTargetKey } from "../StoredTargetKey"; -import { +import type { StoredTargetKey } from "../StoredTargetKey"; +import type { RangePlainObject, SelectionPlainObject, SerializedMarks, diff --git a/packages/common/src/testUtil/extractTargetedMarks.ts b/packages/common/src/testUtil/extractTargetedMarks.ts index 1d5dae616..40a1bc60e 100644 --- a/packages/common/src/testUtil/extractTargetedMarks.ts +++ b/packages/common/src/testUtil/extractTargetedMarks.ts @@ -1,6 +1,6 @@ import { splitKey } from ".."; -import { ReadOnlyHatMap } from "../types/HatTokenMap"; -import { Token } from "../types/Token"; +import type { ReadOnlyHatMap } from "../types/HatTokenMap"; +import type { Token } from "../types/Token"; export function extractTargetedMarks( targetKeys: string[], diff --git a/packages/common/src/testUtil/getSnapshotForComparison.ts b/packages/common/src/testUtil/getSnapshotForComparison.ts index 69cda9cda..c1c12ec9d 100644 --- a/packages/common/src/testUtil/getSnapshotForComparison.ts +++ b/packages/common/src/testUtil/getSnapshotForComparison.ts @@ -1,9 +1,12 @@ import { storedTargetKeys } from "../StoredTargetKey"; -import { SpyIDE } from "../ide/spy/SpyIDE"; -import { ReadOnlyHatMap } from "../types/HatTokenMap"; +import type { SpyIDE } from "../ide/spy/SpyIDE"; +import type { ReadOnlyHatMap } from "../types/HatTokenMap"; import type { TestHelpers } from "../types/TestHelpers"; import { marksToPlainObject } from "../util/toPlainObject"; -import { ExcludableSnapshotField, TestCaseSnapshot } from "./TestCaseSnapshot"; +import type { + ExcludableSnapshotField, + TestCaseSnapshot, +} from "./TestCaseSnapshot"; import { extractTargetedMarks } from "./extractTargetedMarks"; /** diff --git a/packages/common/src/testUtil/serializeTestFixture.ts b/packages/common/src/testUtil/serializeTestFixture.ts index 3604a45d3..2ad2d2a2d 100644 --- a/packages/common/src/testUtil/serializeTestFixture.ts +++ b/packages/common/src/testUtil/serializeTestFixture.ts @@ -1,10 +1,10 @@ -import { TestCaseFixtureLegacy } from "../types/TestCaseFixture"; -import { ActionDescriptor } from "../types/command/ActionDescriptor"; -import { CommandV6 } from "../types/command/CommandV6.types"; -import { CommandV7 } from "../types/command/CommandV7.types"; -import { Command } from "../types/command/command.types"; -import { CommandV5 } from "../types/command/legacy/CommandV5.types"; -import { EnforceUndefined } from "../util/typeUtils"; +import type { TestCaseFixtureLegacy } from "../types/TestCaseFixture"; +import type { ActionDescriptor } from "../types/command/ActionDescriptor"; +import type { CommandV6 } from "../types/command/CommandV6.types"; +import type { CommandV7 } from "../types/command/CommandV7.types"; +import type { Command } from "../types/command/command.types"; +import type { CommandV5 } from "../types/command/legacy/CommandV5.types"; +import type { EnforceUndefined } from "../util/typeUtils"; import { serialize } from "./serialize"; function reorderFields( diff --git a/packages/common/src/testUtil/spyToPlainObject.ts b/packages/common/src/testUtil/spyToPlainObject.ts index 054810685..91ae297a4 100644 --- a/packages/common/src/testUtil/spyToPlainObject.ts +++ b/packages/common/src/testUtil/spyToPlainObject.ts @@ -1,9 +1,9 @@ import type { Message, SpyIDERecordedValues } from ".."; -import { +import type { PlainFlashDescriptor, PlainHighlight, - generalizedRangeToPlainObject, } from "../util/toPlainObject"; +import { generalizedRangeToPlainObject } from "../util/toPlainObject"; export interface PlainSpyIDERecordedValues { messages: Message[] | undefined; diff --git a/packages/common/src/types/Edit.ts b/packages/common/src/types/Edit.ts index 9c51b1a9f..30c63280f 100644 --- a/packages/common/src/types/Edit.ts +++ b/packages/common/src/types/Edit.ts @@ -1,4 +1,4 @@ -import { Range } from ".."; +import type { Range } from ".."; /** Represent a single edit/change in the document */ export interface Edit { diff --git a/packages/common/src/types/GeneralizedRange.ts b/packages/common/src/types/GeneralizedRange.ts index 1161d7b01..e89bd924d 100644 --- a/packages/common/src/types/GeneralizedRange.ts +++ b/packages/common/src/types/GeneralizedRange.ts @@ -1,6 +1,6 @@ -import { Position } from "./Position"; -import { Range } from "./Range"; -import { TextEditor } from "./TextEditor"; +import type { Position } from "./Position"; +import type { Range } from "./Range"; +import type { TextEditor } from "./TextEditor"; /** * A range of lines in a document, unlike the standard {@link Range}, which is diff --git a/packages/common/src/types/HatTokenMap.ts b/packages/common/src/types/HatTokenMap.ts index cc3408cf2..d3660c53e 100644 --- a/packages/common/src/types/HatTokenMap.ts +++ b/packages/common/src/types/HatTokenMap.ts @@ -1,6 +1,6 @@ -import { HatStyleName } from "../ide/types/hatStyles.types"; -import { Range } from "./Range"; -import { Token } from "./Token"; +import type { HatStyleName } from "../ide/types/hatStyles.types"; +import type { Range } from "./Range"; +import type { Token } from "./Token"; /** * Maps from (hatStyle, character) pairs to tokens diff --git a/packages/common/src/types/Position.ts b/packages/common/src/types/Position.ts index 575153092..317c237ad 100644 --- a/packages/common/src/types/Position.ts +++ b/packages/common/src/types/Position.ts @@ -1,4 +1,5 @@ -import { Range, TextDocument } from ".."; +import type { TextDocument } from ".."; +import { Range } from ".."; export class Position { /** diff --git a/packages/common/src/types/ScopeProvider.ts b/packages/common/src/types/ScopeProvider.ts index 0c0cd7335..56bff4cdc 100644 --- a/packages/common/src/types/ScopeProvider.ts +++ b/packages/common/src/types/ScopeProvider.ts @@ -1,4 +1,4 @@ -import { +import type { Disposable, GeneralizedRange, Range, diff --git a/packages/common/src/types/SpokenFormType.ts b/packages/common/src/types/SpokenFormType.ts index dd92c770b..4fda4781e 100644 --- a/packages/common/src/types/SpokenFormType.ts +++ b/packages/common/src/types/SpokenFormType.ts @@ -1,4 +1,4 @@ -import { +import type { ActionType, ModifierType, SimpleScopeTypeType, diff --git a/packages/common/src/types/TalonSpokenForms.ts b/packages/common/src/types/TalonSpokenForms.ts index 63744b934..d8637c72e 100644 --- a/packages/common/src/types/TalonSpokenForms.ts +++ b/packages/common/src/types/TalonSpokenForms.ts @@ -1,5 +1,5 @@ -import { Notifier } from "@cursorless/common"; -import { SpokenFormMapKeyTypes, SpokenFormType } from "./SpokenFormType"; +import type { Notifier } from "@cursorless/common"; +import type { SpokenFormMapKeyTypes, SpokenFormType } from "./SpokenFormType"; /** * Interface representing a communication mechanism whereby Talon can provide diff --git a/packages/common/src/types/Token.ts b/packages/common/src/types/Token.ts index e07d28c81..f88b0b8bf 100644 --- a/packages/common/src/types/Token.ts +++ b/packages/common/src/types/Token.ts @@ -1,9 +1,9 @@ /** * A token within a text editor */ -import { Range } from "./Range"; -import { RangeOffsets } from "./RangeOffsets"; -import { TextEditor } from "./TextEditor"; +import type { Range } from "./Range"; +import type { RangeOffsets } from "./RangeOffsets"; +import type { TextEditor } from "./TextEditor"; /** * A token within a text editor diff --git a/packages/common/src/types/TreeSitter.ts b/packages/common/src/types/TreeSitter.ts index 17d89c5b4..db50589e4 100644 --- a/packages/common/src/types/TreeSitter.ts +++ b/packages/common/src/types/TreeSitter.ts @@ -1,5 +1,5 @@ -import { Range, TextDocument } from "@cursorless/common"; -import { Language, SyntaxNode, Tree } from "web-tree-sitter"; +import type { Range, TextDocument } from "@cursorless/common"; +import type { Language, SyntaxNode, Tree } from "web-tree-sitter"; export interface TreeSitter { /** diff --git a/packages/common/src/types/command/ActionDescriptor.ts b/packages/common/src/types/command/ActionDescriptor.ts index b35fefaeb..200918604 100644 --- a/packages/common/src/types/command/ActionDescriptor.ts +++ b/packages/common/src/types/command/ActionDescriptor.ts @@ -1,8 +1,8 @@ -import { +import type { PartialTargetDescriptor, ScopeType, } from "./PartialTargetDescriptor.types"; -import { DestinationDescriptor } from "./DestinationDescriptor.types"; +import type { DestinationDescriptor } from "./DestinationDescriptor.types"; /** * A simple action takes only a single target and no other arguments. diff --git a/packages/common/src/types/command/DestinationDescriptor.types.ts b/packages/common/src/types/command/DestinationDescriptor.types.ts index 7d04a8b0a..c1168fa06 100644 --- a/packages/common/src/types/command/DestinationDescriptor.types.ts +++ b/packages/common/src/types/command/DestinationDescriptor.types.ts @@ -1,4 +1,4 @@ -import { +import type { PartialListTargetDescriptor, PartialPrimitiveTargetDescriptor, PartialRangeTargetDescriptor, diff --git a/packages/common/src/types/command/legacy/CommandV3.types.ts b/packages/common/src/types/command/legacy/CommandV3.types.ts index 72ab67fbc..fa055cad3 100644 --- a/packages/common/src/types/command/legacy/CommandV3.types.ts +++ b/packages/common/src/types/command/legacy/CommandV3.types.ts @@ -1,4 +1,4 @@ -import { PartialTargetDescriptorV3 } from "./PartialTargetDescriptorV3.types"; +import type { PartialTargetDescriptorV3 } from "./PartialTargetDescriptorV3.types"; type ActionType = | "callAsFunction" diff --git a/packages/common/src/types/command/legacy/CommandV4.types.ts b/packages/common/src/types/command/legacy/CommandV4.types.ts index 31d839e76..4c999f6a6 100644 --- a/packages/common/src/types/command/legacy/CommandV4.types.ts +++ b/packages/common/src/types/command/legacy/CommandV4.types.ts @@ -1,4 +1,4 @@ -import { PartialTargetDescriptorV4 } from "./PartialTargetDescriptorV4.types"; +import type { PartialTargetDescriptorV4 } from "./PartialTargetDescriptorV4.types"; type ActionType = | "callAsFunction" diff --git a/packages/common/src/types/generalizedRangeTouches.test.ts b/packages/common/src/types/generalizedRangeTouches.test.ts index f5d405918..6eca341be 100644 --- a/packages/common/src/types/generalizedRangeTouches.test.ts +++ b/packages/common/src/types/generalizedRangeTouches.test.ts @@ -1,5 +1,6 @@ import assert from "assert"; -import { GeneralizedRange, generalizedRangeTouches, Position } from ".."; +import type { GeneralizedRange } from ".."; +import { generalizedRangeTouches, Position } from ".."; suite("generalizedRangeTouches", () => { test("character", () => { diff --git a/packages/common/src/types/location.types.ts b/packages/common/src/types/location.types.ts index 7496f47f0..9b6a0b3b3 100644 --- a/packages/common/src/types/location.types.ts +++ b/packages/common/src/types/location.types.ts @@ -1,5 +1,5 @@ -import { Range } from "./Range"; -import { TextEditor } from "./TextEditor"; +import type { Range } from "./Range"; +import type { TextEditor } from "./TextEditor"; export interface TextEditorRange { editor: TextEditor; diff --git a/packages/common/src/types/snippet.types.ts b/packages/common/src/types/snippet.types.ts index 9145a888d..4262e1373 100644 --- a/packages/common/src/types/snippet.types.ts +++ b/packages/common/src/types/snippet.types.ts @@ -1,5 +1,5 @@ -import { TextFormatterName } from "../util/textFormatters"; -import { SimpleScopeTypeType } from "./command/PartialTargetDescriptor.types"; +import type { TextFormatterName } from "../util/textFormatters"; +import type { SimpleScopeTypeType } from "./command/PartialTargetDescriptor.types"; export interface SnippetScope { /** diff --git a/packages/common/src/util/disposableFrom.ts b/packages/common/src/util/disposableFrom.ts index a07da6bf4..bf1a6cc42 100644 --- a/packages/common/src/util/disposableFrom.ts +++ b/packages/common/src/util/disposableFrom.ts @@ -1,4 +1,4 @@ -import { Disposable } from "../ide/types/ide.types"; +import type { Disposable } from "../ide/types/ide.types"; /** * Construct a disposable that disposes multiple disposables at once. This is diff --git a/packages/common/src/util/ensureCommandShape.ts b/packages/common/src/util/ensureCommandShape.ts index 1ef906675..b1544a375 100644 --- a/packages/common/src/util/ensureCommandShape.ts +++ b/packages/common/src/util/ensureCommandShape.ts @@ -1,6 +1,6 @@ -import { ActionType } from "../types/command/ActionDescriptor"; -import { Command } from "../types/command/command.types"; -import { PartialTargetV0V1 } from "../types/command/legacy/CommandV0V1.types"; +import type { ActionType } from "../types/command/ActionDescriptor"; +import type { Command } from "../types/command/command.types"; +import type { PartialTargetV0V1 } from "../types/command/legacy/CommandV0V1.types"; import { isString } from "./type"; /** diff --git a/packages/common/src/util/range.ts b/packages/common/src/util/range.ts index 6a0dd944b..6cb9ece57 100644 --- a/packages/common/src/util/range.ts +++ b/packages/common/src/util/range.ts @@ -1,6 +1,6 @@ import { range as lodashRange } from "lodash-es"; -import { Range } from "../types/Range"; -import { TextEditor } from "../types/TextEditor"; +import type { Range } from "../types/Range"; +import type { TextEditor } from "../types/TextEditor"; /** * @param editor The editor containing the range diff --git a/packages/common/src/util/serializedMarksToTokenHats.ts b/packages/common/src/util/serializedMarksToTokenHats.ts index 94203c290..a3aa31b9d 100644 --- a/packages/common/src/util/serializedMarksToTokenHats.ts +++ b/packages/common/src/util/serializedMarksToTokenHats.ts @@ -1,8 +1,8 @@ import { plainObjectToRange } from "../testUtil/fromPlainObject"; import { splitKey } from "./splitKey"; -import { SerializedMarks } from "./toPlainObject"; -import { TextEditor } from "../types/TextEditor"; -import { TokenHat } from "../types/HatTokenMap"; +import type { SerializedMarks } from "./toPlainObject"; +import type { TextEditor } from "../types/TextEditor"; +import type { TokenHat } from "../types/HatTokenMap"; export function serializedMarksToTokenHats( marks: SerializedMarks | undefined, diff --git a/packages/common/src/util/toPlainObject.ts b/packages/common/src/util/toPlainObject.ts index 2b3b6598e..21e9b7964 100644 --- a/packages/common/src/util/toPlainObject.ts +++ b/packages/common/src/util/toPlainObject.ts @@ -4,9 +4,9 @@ import type { LineRange, } from "../types/GeneralizedRange"; import { isLineRange } from "../types/GeneralizedRange"; -import { FlashStyle } from "../ide/types/FlashDescriptor"; -import { Token } from "../types/Token"; -import { Selection } from "../types/Selection"; +import type { FlashStyle } from "../ide/types/FlashDescriptor"; +import type { Token } from "../types/Token"; +import type { Selection } from "../types/Selection"; export type PositionPlainObject = { line: number; diff --git a/packages/cursorless-engine/src/CommandHistory.ts b/packages/cursorless-engine/src/CommandHistory.ts index 811c42168..b68f256b3 100644 --- a/packages/cursorless-engine/src/CommandHistory.ts +++ b/packages/cursorless-engine/src/CommandHistory.ts @@ -1,16 +1,16 @@ -import { +import type { ActionDescriptor, CommandComplete, CommandHistoryEntry, CommandServerApi, IDE, ReadOnlyHatMap, - type CommandHistoryStorage, } from "@cursorless/common"; +import { type CommandHistoryStorage } from "@cursorless/common"; import { produce } from "immer"; import { v4 as uuid } from "uuid"; -import { CommandRunner } from "./CommandRunner"; -import { CommandRunnerDecorator } from "./api/CursorlessEngineApi"; +import type { CommandRunner } from "./CommandRunner"; +import type { CommandRunnerDecorator } from "./api/CursorlessEngineApi"; const filePrefix = "cursorlessCommandHistory"; diff --git a/packages/cursorless-engine/src/CommandHistoryAnalyzer.ts b/packages/cursorless-engine/src/CommandHistoryAnalyzer.ts index a7cfdd9e8..4efe0f33c 100644 --- a/packages/cursorless-engine/src/CommandHistoryAnalyzer.ts +++ b/packages/cursorless-engine/src/CommandHistoryAnalyzer.ts @@ -1,11 +1,10 @@ -import { +import type { CommandHistoryEntry, Modifier, PartialPrimitiveTargetDescriptor, ScopeType, - showWarning, - type CommandHistoryStorage, } from "@cursorless/common"; +import { showWarning, type CommandHistoryStorage } from "@cursorless/common"; import { groupBy, map, sum } from "lodash-es"; import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import { ide } from "./singletons/ide.singleton"; diff --git a/packages/cursorless-engine/src/KeyboardTargetUpdater.ts b/packages/cursorless-engine/src/KeyboardTargetUpdater.ts index e044097f3..a2518b008 100644 --- a/packages/cursorless-engine/src/KeyboardTargetUpdater.ts +++ b/packages/cursorless-engine/src/KeyboardTargetUpdater.ts @@ -1,5 +1,5 @@ -import { Disposable, IDE } from "@cursorless/common"; -import { StoredTargetMap } from "./core/StoredTargets"; +import type { Disposable, IDE } from "@cursorless/common"; +import type { StoredTargetMap } from "./core/StoredTargets"; import { CursorStage } from "./processTargets/marks/CursorStage"; import { DecorationDebouncer } from "./util/DecorationDebouncer"; diff --git a/packages/cursorless-engine/src/actions/Actions.ts b/packages/cursorless-engine/src/actions/Actions.ts index a9bf4bb16..1e975a5d9 100644 --- a/packages/cursorless-engine/src/actions/Actions.ts +++ b/packages/cursorless-engine/src/actions/Actions.ts @@ -1,7 +1,7 @@ import type { TreeSitter } from "@cursorless/common"; -import { Snippets } from "../core/Snippets"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { Snippets } from "../core/Snippets"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { BreakLine } from "./BreakLine"; import { Bring, Move, Swap } from "./BringMoveSwap"; import Call from "./Call"; @@ -59,7 +59,7 @@ import { Random, Reverse, Sort } from "./Sort"; import ToggleBreakpoint from "./ToggleBreakpoint"; import Wrap from "./Wrap"; import WrapWithSnippet from "./WrapWithSnippet"; -import { ActionRecord } from "./actions.types"; +import type { ActionRecord } from "./actions.types"; import { Decrement, Increment } from "./incrementDecrement"; /** diff --git a/packages/cursorless-engine/src/actions/BreakLine.ts b/packages/cursorless-engine/src/actions/BreakLine.ts index 32eedd487..030b1a1bc 100644 --- a/packages/cursorless-engine/src/actions/BreakLine.ts +++ b/packages/cursorless-engine/src/actions/BreakLine.ts @@ -1,15 +1,10 @@ -import { - Edit, - FlashStyle, - Position, - Range, - TextEditor, -} from "@cursorless/common"; +import type { Edit, TextEditor } from "@cursorless/common"; +import { FlashStyle, Position, Range } from "@cursorless/common"; import { flatten, zip } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { flashTargets, runOnTargetsForEachEditor } from "../util/targetUtils"; import type { ActionReturnValue } from "./actions.types"; diff --git a/packages/cursorless-engine/src/actions/BringMoveSwap.ts b/packages/cursorless-engine/src/actions/BringMoveSwap.ts index d2de8599c..63f53fb74 100644 --- a/packages/cursorless-engine/src/actions/BringMoveSwap.ts +++ b/packages/cursorless-engine/src/actions/BringMoveSwap.ts @@ -1,23 +1,18 @@ -import { - FlashStyle, - Range, - RangeExpansionBehavior, - Selection, - TextEditor, -} from "@cursorless/common"; +import type { Range, Selection, TextEditor } from "@cursorless/common"; +import { FlashStyle, RangeExpansionBehavior } from "@cursorless/common"; import { flatten } from "lodash-es"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { EditWithRangeUpdater } from "../typings/Types"; -import { Destination, Target } from "../typings/target.types"; +import type { EditWithRangeUpdater } from "../typings/Types"; +import type { Destination, Target } from "../typings/target.types"; import { flashTargets, getContentRange, runForEachEditor, } from "../util/targetUtils"; import { unifyRemovalTargets } from "../util/unifyRanges"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; type ActionType = "bring" | "move" | "swap"; diff --git a/packages/cursorless-engine/src/actions/Call.ts b/packages/cursorless-engine/src/actions/Call.ts index 501bd4dbc..d78ef4d94 100644 --- a/packages/cursorless-engine/src/actions/Call.ts +++ b/packages/cursorless-engine/src/actions/Call.ts @@ -1,7 +1,7 @@ -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleTarget } from "../util/targetUtils"; -import { Actions } from "./Actions"; -import { ActionReturnValue } from "./actions.types"; +import type { Actions } from "./Actions"; +import type { ActionReturnValue } from "./actions.types"; export default class Call { constructor(private actions: Actions) { diff --git a/packages/cursorless-engine/src/actions/CallbackAction.ts b/packages/cursorless-engine/src/actions/CallbackAction.ts index 883867699..f675e52b3 100644 --- a/packages/cursorless-engine/src/actions/CallbackAction.ts +++ b/packages/cursorless-engine/src/actions/CallbackAction.ts @@ -1,10 +1,11 @@ -import { EditableTextEditor, FlashStyle, TextEditor } from "@cursorless/common"; +import type { EditableTextEditor, TextEditor } from "@cursorless/common"; +import { FlashStyle } from "@cursorless/common"; import { flatten } from "lodash-es"; import { selectionToStoredTarget } from "../core/commandRunner/selectionToStoredTarget"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleEditor, ensureSingleTarget, @@ -12,7 +13,7 @@ import { runOnTargetsForEachEditor, runOnTargetsForEachEditorSequentially, } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; interface CallbackOptions { callback: (editor: EditableTextEditor, targets: Target[]) => Promise; diff --git a/packages/cursorless-engine/src/actions/Clear.ts b/packages/cursorless-engine/src/actions/Clear.ts index 38c2f9078..2de38e822 100644 --- a/packages/cursorless-engine/src/actions/Clear.ts +++ b/packages/cursorless-engine/src/actions/Clear.ts @@ -1,9 +1,9 @@ import { PlainTarget } from "../processTargets/targets"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleEditor } from "../util/targetUtils"; -import { Actions } from "./Actions"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { Actions } from "./Actions"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; export default class Clear implements SimpleAction { constructor(private actions: Actions) { diff --git a/packages/cursorless-engine/src/actions/CutToClipboard.ts b/packages/cursorless-engine/src/actions/CutToClipboard.ts index 5e92832dd..a5c93f114 100644 --- a/packages/cursorless-engine/src/actions/CutToClipboard.ts +++ b/packages/cursorless-engine/src/actions/CutToClipboard.ts @@ -1,14 +1,14 @@ +import type { FlashDescriptor } from "@cursorless/common"; import { - FlashDescriptor, FlashStyle, Range, toCharacterRange, toLineRange, } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; -import { Actions } from "./Actions"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { Target } from "../typings/target.types"; +import type { Actions } from "./Actions"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; export class CutToClipboard implements SimpleAction { constructor(private actions: Actions) { diff --git a/packages/cursorless-engine/src/actions/Deselect.ts b/packages/cursorless-engine/src/actions/Deselect.ts index 8c332141d..1848f8d5c 100644 --- a/packages/cursorless-engine/src/actions/Deselect.ts +++ b/packages/cursorless-engine/src/actions/Deselect.ts @@ -1,7 +1,7 @@ import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; export default class Deselect implements SimpleAction { constructor() { diff --git a/packages/cursorless-engine/src/actions/EditNew/EditNew.ts b/packages/cursorless-engine/src/actions/EditNew/EditNew.ts index 6c5a26e5f..f4c3f2e8a 100644 --- a/packages/cursorless-engine/src/actions/EditNew/EditNew.ts +++ b/packages/cursorless-engine/src/actions/EditNew/EditNew.ts @@ -1,10 +1,10 @@ -import { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; import { ide } from "../../singletons/ide.singleton"; -import { Destination } from "../../typings/target.types"; +import type { Destination } from "../../typings/target.types"; import { createThatMark, ensureSingleEditor } from "../../util/targetUtils"; -import { Actions } from "../Actions"; -import { ActionReturnValue } from "../actions.types"; -import { State } from "./EditNew.types"; +import type { Actions } from "../Actions"; +import type { ActionReturnValue } from "../actions.types"; +import type { State } from "./EditNew.types"; import { runEditTargets } from "./runEditTargets"; import { runInsertLineAfterTargets } from "./runInsertLineAfterTargets"; import { runEditNewNotebookCellTargets } from "./runNotebookCellTargets"; diff --git a/packages/cursorless-engine/src/actions/EditNew/runEditTargets.ts b/packages/cursorless-engine/src/actions/EditNew/runEditTargets.ts index 64366e33c..0f1e337d5 100644 --- a/packages/cursorless-engine/src/actions/EditNew/runEditTargets.ts +++ b/packages/cursorless-engine/src/actions/EditNew/runEditTargets.ts @@ -1,8 +1,9 @@ -import { EditableTextEditor, RangeExpansionBehavior } from "@cursorless/common"; +import type { EditableTextEditor } from "@cursorless/common"; +import { RangeExpansionBehavior } from "@cursorless/common"; import { zip } from "lodash-es"; -import { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../../core/updateSelections/updateSelections"; -import { EditDestination, State } from "./EditNew.types"; +import type { EditDestination, State } from "./EditNew.types"; /** * Handle targets that will use an edit action to insert a new target, and diff --git a/packages/cursorless-engine/src/actions/EditNew/runInsertLineAfterTargets.ts b/packages/cursorless-engine/src/actions/EditNew/runInsertLineAfterTargets.ts index 38a29b988..32bc6eb2c 100644 --- a/packages/cursorless-engine/src/actions/EditNew/runInsertLineAfterTargets.ts +++ b/packages/cursorless-engine/src/actions/EditNew/runInsertLineAfterTargets.ts @@ -1,7 +1,10 @@ -import { CommandCapabilities, EditableTextEditor } from "@cursorless/common"; -import { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; +import type { + CommandCapabilities, + EditableTextEditor, +} from "@cursorless/common"; +import type { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../../core/updateSelections/updateSelections"; -import { EditDestination, State } from "./EditNew.types"; +import type { EditDestination, State } from "./EditNew.types"; /** * Handle targets that will use a VSCode command to insert a new target, eg diff --git a/packages/cursorless-engine/src/actions/EditNew/runNotebookCellTargets.ts b/packages/cursorless-engine/src/actions/EditNew/runNotebookCellTargets.ts index 2cfeaf548..4e3ab4392 100644 --- a/packages/cursorless-engine/src/actions/EditNew/runNotebookCellTargets.ts +++ b/packages/cursorless-engine/src/actions/EditNew/runNotebookCellTargets.ts @@ -1,9 +1,9 @@ -import { Selection } from "@cursorless/common"; +import type { Selection } from "@cursorless/common"; import { ide } from "../../singletons/ide.singleton"; -import { Destination } from "../../typings/target.types"; +import type { Destination } from "../../typings/target.types"; import { createThatMark, ensureSingleTarget } from "../../util/targetUtils"; -import { Actions } from "../Actions"; -import { ActionReturnValue } from "../actions.types"; +import type { Actions } from "../Actions"; +import type { ActionReturnValue } from "../actions.types"; export async function runEditNewNotebookCellTargets( actions: Actions, diff --git a/packages/cursorless-engine/src/actions/EditNewLineAction.ts b/packages/cursorless-engine/src/actions/EditNewLineAction.ts index 624bcc786..d5c02f6f5 100644 --- a/packages/cursorless-engine/src/actions/EditNewLineAction.ts +++ b/packages/cursorless-engine/src/actions/EditNewLineAction.ts @@ -1,8 +1,12 @@ -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; -import { ModifierStage } from "../processTargets/PipelineStages.types"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ModifierStage } from "../processTargets/PipelineStages.types"; import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; -import { Target } from "../typings/target.types"; -import { ActionRecord, ActionReturnValue, SimpleAction } from "./actions.types"; +import type { Target } from "../typings/target.types"; +import type { + ActionRecord, + ActionReturnValue, + SimpleAction, +} from "./actions.types"; abstract class EditNewLineAction implements SimpleAction { getFinalStages(): ModifierStage[] { diff --git a/packages/cursorless-engine/src/actions/ExecuteCommand.ts b/packages/cursorless-engine/src/actions/ExecuteCommand.ts index 9a64d6a0b..e6c8a41e3 100644 --- a/packages/cursorless-engine/src/actions/ExecuteCommand.ts +++ b/packages/cursorless-engine/src/actions/ExecuteCommand.ts @@ -1,9 +1,9 @@ -import { ExecuteCommandOptions } from "@cursorless/common"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { ExecuteCommandOptions } from "@cursorless/common"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { CallbackAction } from "./CallbackAction"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; /** * This action can be used to execute a built-in ide command on one or more diff --git a/packages/cursorless-engine/src/actions/Find.ts b/packages/cursorless-engine/src/actions/Find.ts index ed12488c2..c0d0f4e73 100644 --- a/packages/cursorless-engine/src/actions/Find.ts +++ b/packages/cursorless-engine/src/actions/Find.ts @@ -1,9 +1,9 @@ import { showWarning } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleTarget } from "../util/targetUtils"; -import { Actions } from "./Actions"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { Actions } from "./Actions"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; abstract class Find implements SimpleAction { constructor(private actions: Actions) { diff --git a/packages/cursorless-engine/src/actions/FollowLink.ts b/packages/cursorless-engine/src/actions/FollowLink.ts index 0826719fb..e4f3ec13e 100644 --- a/packages/cursorless-engine/src/actions/FollowLink.ts +++ b/packages/cursorless-engine/src/actions/FollowLink.ts @@ -1,12 +1,13 @@ -import { FlashStyle, OpenLinkOptions } from "@cursorless/common"; +import type { OpenLinkOptions } from "@cursorless/common"; +import { FlashStyle } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { createThatMark, ensureSingleTarget, flashTargets, } from "../util/targetUtils"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; export default class FollowLink implements SimpleAction { constructor(private options: OpenLinkOptions) { diff --git a/packages/cursorless-engine/src/actions/GetTargets.ts b/packages/cursorless-engine/src/actions/GetTargets.ts index 5dc52bacb..e41266701 100644 --- a/packages/cursorless-engine/src/actions/GetTargets.ts +++ b/packages/cursorless-engine/src/actions/GetTargets.ts @@ -1,5 +1,5 @@ -import { Target } from "../typings/target.types"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { Target } from "../typings/target.types"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; export default class GetTargets implements SimpleAction { constructor() { diff --git a/packages/cursorless-engine/src/actions/GetText.ts b/packages/cursorless-engine/src/actions/GetText.ts index fdfb0efe2..1f7bac354 100644 --- a/packages/cursorless-engine/src/actions/GetText.ts +++ b/packages/cursorless-engine/src/actions/GetText.ts @@ -1,8 +1,9 @@ -import { FlashStyle, GetTextActionOptions } from "@cursorless/common"; +import type { GetTextActionOptions } from "@cursorless/common"; +import { FlashStyle } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleTarget, flashTargets } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; export default class GetText { constructor() { diff --git a/packages/cursorless-engine/src/actions/Highlight.ts b/packages/cursorless-engine/src/actions/Highlight.ts index ae418ae5b..c6a27b295 100644 --- a/packages/cursorless-engine/src/actions/Highlight.ts +++ b/packages/cursorless-engine/src/actions/Highlight.ts @@ -1,11 +1,11 @@ -import { HighlightId } from "@cursorless/common"; +import type { HighlightId } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { runOnTargetsForEachEditor, toGeneralizedRange, } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; export default class Highlight { constructor() { diff --git a/packages/cursorless-engine/src/actions/IndentLine.ts b/packages/cursorless-engine/src/actions/IndentLine.ts index 9bf0d9e16..ae4eb8496 100644 --- a/packages/cursorless-engine/src/actions/IndentLine.ts +++ b/packages/cursorless-engine/src/actions/IndentLine.ts @@ -3,13 +3,13 @@ import { flatten, zip } from "lodash-es"; import { selectionToStoredTarget } from "../core/commandRunner/selectionToStoredTarget"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { flashTargets, runOnTargetsForEachEditor } from "../util/targetUtils"; import { IndentLineSimpleAction, OutdentLineSimpleAction, } from "./SimpleIdeCommandActions"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; abstract class IndentLineBase { diff --git a/packages/cursorless-engine/src/actions/InsertCopy.ts b/packages/cursorless-engine/src/actions/InsertCopy.ts index 7440dc1b7..71c5f6eba 100644 --- a/packages/cursorless-engine/src/actions/InsertCopy.ts +++ b/packages/cursorless-engine/src/actions/InsertCopy.ts @@ -1,18 +1,18 @@ +import type { TextEditor } from "@cursorless/common"; import { FlashStyle, RangeExpansionBehavior, - TextEditor, toCharacterRange, } from "@cursorless/common"; import { flatten, zip } from "lodash-es"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { createThatMark, runOnTargetsForEachEditor } from "../util/targetUtils"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; class InsertCopy implements SimpleAction { getFinalStages = () => [ diff --git a/packages/cursorless-engine/src/actions/InsertEmptyLines.ts b/packages/cursorless-engine/src/actions/InsertEmptyLines.ts index f9ae3f8f3..8cc455109 100644 --- a/packages/cursorless-engine/src/actions/InsertEmptyLines.ts +++ b/packages/cursorless-engine/src/actions/InsertEmptyLines.ts @@ -1,11 +1,11 @@ import { FlashStyle, Range, toLineRange } from "@cursorless/common"; import { flatten } from "lodash-es"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; class InsertEmptyLines implements SimpleAction { constructor( diff --git a/packages/cursorless-engine/src/actions/InsertSnippet.ts b/packages/cursorless-engine/src/actions/InsertSnippet.ts index 375a9e0b3..f7ca4c9e2 100644 --- a/packages/cursorless-engine/src/actions/InsertSnippet.ts +++ b/packages/cursorless-engine/src/actions/InsertSnippet.ts @@ -1,15 +1,14 @@ -import { +import type { InsertSnippetArg, - RangeExpansionBehavior, ScopeType, Snippet, SnippetDefinition, - textFormatters, } from "@cursorless/common"; -import { Snippets } from "../core/Snippets"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import { RangeExpansionBehavior, textFormatters } from "@cursorless/common"; +import type { Snippets } from "../core/Snippets"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { ModifyIfUntypedExplicitStage } from "../processTargets/modifiers/ConditionalModifierStages"; import { UntypedTarget } from "../processTargets/targets"; import { ide } from "../singletons/ide.singleton"; @@ -18,10 +17,10 @@ import { transformSnippetVariables, } from "../snippets/snippet"; import { SnippetParser } from "../snippets/vendor/vscodeSnippet/snippetParser"; -import { Destination, Target } from "../typings/target.types"; +import type { Destination, Target } from "../typings/target.types"; import { ensureSingleEditor } from "../util/targetUtils"; -import { Actions } from "./Actions"; -import { ActionReturnValue } from "./actions.types"; +import type { Actions } from "./Actions"; +import type { ActionReturnValue } from "./actions.types"; export default class InsertSnippet { private snippetParser = new SnippetParser(); diff --git a/packages/cursorless-engine/src/actions/JoinLines.ts b/packages/cursorless-engine/src/actions/JoinLines.ts index ab5211248..4684e713f 100644 --- a/packages/cursorless-engine/src/actions/JoinLines.ts +++ b/packages/cursorless-engine/src/actions/JoinLines.ts @@ -1,10 +1,11 @@ -import { Edit, FlashStyle, Range, TextEditor } from "@cursorless/common"; +import type { Edit, TextEditor } from "@cursorless/common"; +import { FlashStyle, Range } from "@cursorless/common"; import { range as iterRange, map, pairwise } from "itertools"; import { flatten, zip } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { flashTargets, runOnTargetsForEachEditor } from "../util/targetUtils"; import type { ActionReturnValue } from "./actions.types"; diff --git a/packages/cursorless-engine/src/actions/PasteFromClipboard.ts b/packages/cursorless-engine/src/actions/PasteFromClipboard.ts index ac0173599..71d477262 100644 --- a/packages/cursorless-engine/src/actions/PasteFromClipboard.ts +++ b/packages/cursorless-engine/src/actions/PasteFromClipboard.ts @@ -1,4 +1,4 @@ -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { ide } from "../singletons/ide.singleton"; import type { Destination } from "../typings/target.types"; import type { Actions } from "./Actions"; diff --git a/packages/cursorless-engine/src/actions/PasteFromClipboardDirectly.ts b/packages/cursorless-engine/src/actions/PasteFromClipboardDirectly.ts index e389c3dba..6a5b07dc1 100644 --- a/packages/cursorless-engine/src/actions/PasteFromClipboardDirectly.ts +++ b/packages/cursorless-engine/src/actions/PasteFromClipboardDirectly.ts @@ -6,13 +6,13 @@ import { type TextEditor, } from "@cursorless/common"; import { flatten } from "lodash-es"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; import type { Destination } from "../typings/target.types"; import { runForEachEditor } from "../util/targetUtils"; import type { ActionReturnValue } from "./actions.types"; -import { DestinationWithText } from "./PasteFromClipboard"; +import type { DestinationWithText } from "./PasteFromClipboard"; /** * This action pastes the text from the clipboard into the target editor directly diff --git a/packages/cursorless-engine/src/actions/PasteFromClipboardUsingCommand.ts b/packages/cursorless-engine/src/actions/PasteFromClipboardUsingCommand.ts index 0ea1da123..42e52a550 100644 --- a/packages/cursorless-engine/src/actions/PasteFromClipboardUsingCommand.ts +++ b/packages/cursorless-engine/src/actions/PasteFromClipboardUsingCommand.ts @@ -3,7 +3,7 @@ import { RangeExpansionBehavior, toCharacterRange, } from "@cursorless/common"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; import type { Destination } from "../typings/target.types"; diff --git a/packages/cursorless-engine/src/actions/Remove.ts b/packages/cursorless-engine/src/actions/Remove.ts index 017ae56d7..dd7ea565a 100644 --- a/packages/cursorless-engine/src/actions/Remove.ts +++ b/packages/cursorless-engine/src/actions/Remove.ts @@ -1,13 +1,14 @@ -import { FlashStyle, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { FlashStyle } from "@cursorless/common"; import { flatten, zip } from "lodash-es"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { RawSelectionTarget } from "../processTargets/targets"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { flashTargets, runOnTargetsForEachEditor } from "../util/targetUtils"; import { unifyRemovalTargets } from "../util/unifyRanges"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; export default class Delete implements SimpleAction { constructor(private rangeUpdater: RangeUpdater) { diff --git a/packages/cursorless-engine/src/actions/Replace.ts b/packages/cursorless-engine/src/actions/Replace.ts index 7e6ca746b..4d1efa061 100644 --- a/packages/cursorless-engine/src/actions/Replace.ts +++ b/packages/cursorless-engine/src/actions/Replace.ts @@ -1,16 +1,13 @@ -import { - FlashStyle, - RangeExpansionBehavior, - ReplaceWith, -} from "@cursorless/common"; +import type { ReplaceWith } from "@cursorless/common"; +import { FlashStyle, RangeExpansionBehavior } from "@cursorless/common"; import { zip } from "lodash-es"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { SelectionWithEditor } from "../typings/Types"; -import { Destination, Target } from "../typings/target.types"; +import type { SelectionWithEditor } from "../typings/Types"; +import type { Destination, Target } from "../typings/target.types"; import { flashTargets, runForEachEditor } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; export default class Replace { constructor(private rangeUpdater: RangeUpdater) { diff --git a/packages/cursorless-engine/src/actions/Rewrap.ts b/packages/cursorless-engine/src/actions/Rewrap.ts index 5eb2a8d2c..3b9030654 100644 --- a/packages/cursorless-engine/src/actions/Rewrap.ts +++ b/packages/cursorless-engine/src/actions/Rewrap.ts @@ -1,16 +1,16 @@ import { FlashStyle } from "@cursorless/common"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { getContainingSurroundingPairIfNoBoundaryStage } from "../processTargets/modifiers/InteriorStage"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { createThatMark, flashTargets, runOnTargetsForEachEditor, } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; export default class Rewrap { getFinalStages = () => [ diff --git a/packages/cursorless-engine/src/actions/Scroll.ts b/packages/cursorless-engine/src/actions/Scroll.ts index 4be888e1b..d079e224d 100644 --- a/packages/cursorless-engine/src/actions/Scroll.ts +++ b/packages/cursorless-engine/src/actions/Scroll.ts @@ -5,8 +5,8 @@ import { toLineRange, } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { Target } from "../typings/target.types"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; class Scroll implements SimpleAction { constructor(private at: RevealLineAt) { diff --git a/packages/cursorless-engine/src/actions/SetSelection.ts b/packages/cursorless-engine/src/actions/SetSelection.ts index ea0c5f447..2bab32a85 100644 --- a/packages/cursorless-engine/src/actions/SetSelection.ts +++ b/packages/cursorless-engine/src/actions/SetSelection.ts @@ -1,8 +1,8 @@ import { Selection } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleEditor } from "../util/targetUtils"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; export class SetSelection implements SimpleAction { constructor() { diff --git a/packages/cursorless-engine/src/actions/SetSpecialTarget.ts b/packages/cursorless-engine/src/actions/SetSpecialTarget.ts index a7c64cc71..2c514599b 100644 --- a/packages/cursorless-engine/src/actions/SetSpecialTarget.ts +++ b/packages/cursorless-engine/src/actions/SetSpecialTarget.ts @@ -1,6 +1,6 @@ -import { StoredTargetKey } from "@cursorless/common"; -import { Target } from "../typings/target.types"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { StoredTargetKey } from "@cursorless/common"; +import type { Target } from "../typings/target.types"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; export class SetSpecialTarget implements SimpleAction { noAutomaticTokenExpansion = true; diff --git a/packages/cursorless-engine/src/actions/ShowParseTree.ts b/packages/cursorless-engine/src/actions/ShowParseTree.ts index b53f82294..e93617500 100644 --- a/packages/cursorless-engine/src/actions/ShowParseTree.ts +++ b/packages/cursorless-engine/src/actions/ShowParseTree.ts @@ -1,5 +1,5 @@ -import type { TreeSitter } from "@cursorless/common"; -import { FlashStyle, Range, TextDocument } from "@cursorless/common"; +import type { TreeSitter, TextDocument } from "@cursorless/common"; +import { FlashStyle, Range } from "@cursorless/common"; import type { Tree, TreeCursor } from "web-tree-sitter"; import { ide } from "../singletons/ide.singleton"; import type { Target } from "../typings/target.types"; diff --git a/packages/cursorless-engine/src/actions/SimpleIdeCommandActions.ts b/packages/cursorless-engine/src/actions/SimpleIdeCommandActions.ts index 8b6e6b6cf..9ee59e3e0 100644 --- a/packages/cursorless-engine/src/actions/SimpleIdeCommandActions.ts +++ b/packages/cursorless-engine/src/actions/SimpleIdeCommandActions.ts @@ -1,9 +1,9 @@ -import { CommandId, EditableTextEditor, Range } from "@cursorless/common"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { CommandId, EditableTextEditor, Range } from "@cursorless/common"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { CallbackAction } from "./CallbackAction"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; interface Options { showDecorations?: boolean; diff --git a/packages/cursorless-engine/src/actions/Sort.ts b/packages/cursorless-engine/src/actions/Sort.ts index 5a51dd239..a3cccdbed 100644 --- a/packages/cursorless-engine/src/actions/Sort.ts +++ b/packages/cursorless-engine/src/actions/Sort.ts @@ -1,9 +1,9 @@ import { showWarning } from "@cursorless/common"; import { shuffle } from "lodash-es"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; -import { Actions } from "./Actions"; -import { ActionReturnValue, SimpleAction } from "./actions.types"; +import type { Target } from "../typings/target.types"; +import type { Actions } from "./Actions"; +import type { ActionReturnValue, SimpleAction } from "./actions.types"; abstract class SortBase implements SimpleAction { constructor(private actions: Actions) { diff --git a/packages/cursorless-engine/src/actions/ToggleBreakpoint.ts b/packages/cursorless-engine/src/actions/ToggleBreakpoint.ts index b49988ad3..fcc65da5f 100644 --- a/packages/cursorless-engine/src/actions/ToggleBreakpoint.ts +++ b/packages/cursorless-engine/src/actions/ToggleBreakpoint.ts @@ -1,10 +1,11 @@ -import { BreakpointDescriptor, FlashStyle } from "@cursorless/common"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { BreakpointDescriptor } from "@cursorless/common"; +import { FlashStyle } from "@cursorless/common"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { flashTargets, runOnTargetsForEachEditor } from "../util/targetUtils"; -import { SimpleAction, ActionReturnValue } from "./actions.types"; +import type { SimpleAction, ActionReturnValue } from "./actions.types"; export default class ToggleBreakpoint implements SimpleAction { getFinalStages = () => [ diff --git a/packages/cursorless-engine/src/actions/Wrap.ts b/packages/cursorless-engine/src/actions/Wrap.ts index d7c1b76c3..8fe65a5bc 100644 --- a/packages/cursorless-engine/src/actions/Wrap.ts +++ b/packages/cursorless-engine/src/actions/Wrap.ts @@ -1,16 +1,16 @@ +import type { Edit } from "@cursorless/common"; import { - Edit, FlashStyle, RangeExpansionBehavior, Selection, toCharacterRange, } from "@cursorless/common"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { ide } from "../singletons/ide.singleton"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; export default class Wrap { constructor(private rangeUpdater: RangeUpdater) { diff --git a/packages/cursorless-engine/src/actions/WrapWithSnippet.ts b/packages/cursorless-engine/src/actions/WrapWithSnippet.ts index c7588d4a5..07c33d3f9 100644 --- a/packages/cursorless-engine/src/actions/WrapWithSnippet.ts +++ b/packages/cursorless-engine/src/actions/WrapWithSnippet.ts @@ -1,8 +1,9 @@ -import { FlashStyle, ScopeType, WrapWithSnippetArg } from "@cursorless/common"; -import { Snippets } from "../core/Snippets"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { ScopeType, WrapWithSnippetArg } from "@cursorless/common"; +import { FlashStyle } from "@cursorless/common"; +import type { Snippets } from "../core/Snippets"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { ModifyIfUntypedStage } from "../processTargets/modifiers/ConditionalModifierStages"; import { ide } from "../singletons/ide.singleton"; import { @@ -10,9 +11,9 @@ import { transformSnippetVariables, } from "../snippets/snippet"; import { SnippetParser } from "../snippets/vendor/vscodeSnippet/snippetParser"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { ensureSingleEditor, flashTargets } from "../util/targetUtils"; -import { ActionReturnValue } from "./actions.types"; +import type { ActionReturnValue } from "./actions.types"; export default class WrapWithSnippet { private snippetParser = new SnippetParser(); diff --git a/packages/cursorless-engine/src/actions/incrementDecrement.ts b/packages/cursorless-engine/src/actions/incrementDecrement.ts index 42606cd4d..17d1d3685 100644 --- a/packages/cursorless-engine/src/actions/incrementDecrement.ts +++ b/packages/cursorless-engine/src/actions/incrementDecrement.ts @@ -1,10 +1,11 @@ -import { MatchedText, Range, TextEditor, matchText } from "@cursorless/common"; +import type { MatchedText, TextEditor } from "@cursorless/common"; +import { Range, matchText } from "@cursorless/common"; import { PlainTarget } from "../processTargets/targets"; -import { SelectionWithEditor } from "../typings/Types"; -import { Destination, Target } from "../typings/target.types"; +import type { SelectionWithEditor } from "../typings/Types"; +import type { Destination, Target } from "../typings/target.types"; import { runForEachEditor } from "../util/targetUtils"; -import { Actions } from "./Actions"; -import { ActionReturnValue } from "./actions.types"; +import type { Actions } from "./Actions"; +import type { ActionReturnValue } from "./actions.types"; const REGEX = /-?\d+(\.\d+)?/g; diff --git a/packages/cursorless-engine/src/core/HatAllocator.ts b/packages/cursorless-engine/src/core/HatAllocator.ts index c50711f52..ec480ea22 100644 --- a/packages/cursorless-engine/src/core/HatAllocator.ts +++ b/packages/cursorless-engine/src/core/HatAllocator.ts @@ -2,7 +2,7 @@ import type { Disposable, Hats, TokenHat } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; import tokenGraphemeSplitter from "../singletons/tokenGraphemeSplitter.singleton"; import { allocateHats } from "../util/allocateHats"; -import { IndividualHatMap } from "./IndividualHatMap"; +import type { IndividualHatMap } from "./IndividualHatMap"; import { DecorationDebouncer } from "../util/DecorationDebouncer"; interface Context { diff --git a/packages/cursorless-engine/src/core/HatTokenMapImpl.ts b/packages/cursorless-engine/src/core/HatTokenMapImpl.ts index b13895a54..e571a553b 100644 --- a/packages/cursorless-engine/src/core/HatTokenMapImpl.ts +++ b/packages/cursorless-engine/src/core/HatTokenMapImpl.ts @@ -1,4 +1,4 @@ -import { +import type { CommandServerApi, HatTokenMap, Hats, @@ -6,10 +6,10 @@ import { TokenHat, } from "@cursorless/common"; import { ide } from "../singletons/ide.singleton"; -import { Debug } from "./Debug"; +import type { Debug } from "./Debug"; import { HatAllocator } from "./HatAllocator"; import { IndividualHatMap } from "./IndividualHatMap"; -import { RangeUpdater } from "./updateSelections/RangeUpdater"; +import type { RangeUpdater } from "./updateSelections/RangeUpdater"; /** * Maximum age for the pre-phrase snapshot before we consider it to be stale diff --git a/packages/cursorless-engine/src/core/IndividualHatMap.ts b/packages/cursorless-engine/src/core/IndividualHatMap.ts index 5980fbc4b..b33e30b9e 100644 --- a/packages/cursorless-engine/src/core/IndividualHatMap.ts +++ b/packages/cursorless-engine/src/core/IndividualHatMap.ts @@ -1,15 +1,15 @@ -import { - getKey, +import type { HatStyleName, ReadOnlyHatMap, TextDocument, Token, TokenHat, } from "@cursorless/common"; +import { getKey } from "@cursorless/common"; import tokenGraphemeSplitter from "../singletons/tokenGraphemeSplitter.singleton"; import { getMatcher } from "../tokenizer"; -import { FullRangeInfo } from "../typings/updateSelections"; -import { RangeUpdater } from "./updateSelections/RangeUpdater"; +import type { FullRangeInfo } from "../typings/updateSelections"; +import type { RangeUpdater } from "./updateSelections/RangeUpdater"; /** * A token with information that the rangeUpdater can use to keep its diff --git a/packages/cursorless-engine/src/core/Snippets.ts b/packages/cursorless-engine/src/core/Snippets.ts index b4633a047..5b041dc93 100644 --- a/packages/cursorless-engine/src/core/Snippets.ts +++ b/packages/cursorless-engine/src/core/Snippets.ts @@ -1,4 +1,4 @@ -import { Snippet, SnippetMap } from "@cursorless/common"; +import type { Snippet, SnippetMap } from "@cursorless/common"; /** * Handles all cursorless snippets, including core, third-party and diff --git a/packages/cursorless-engine/src/core/StoredTargets.ts b/packages/cursorless-engine/src/core/StoredTargets.ts index f4472317a..7bcd4b499 100644 --- a/packages/cursorless-engine/src/core/StoredTargets.ts +++ b/packages/cursorless-engine/src/core/StoredTargets.ts @@ -1,6 +1,7 @@ import { DefaultMap, Notifier } from "@cursorless/common"; -import { Target } from "../typings/target.types"; -import { StoredTargetKey, storedTargetKeys } from "@cursorless/common"; +import type { Target } from "../typings/target.types"; +import type { StoredTargetKey } from "@cursorless/common"; +import { storedTargetKeys } from "@cursorless/common"; import { UndoStack } from "./UndoStack"; const MAX_HISTORY_LENGTH = 25; diff --git a/packages/cursorless-engine/src/core/commandRunner/CommandRunnerImpl.ts b/packages/cursorless-engine/src/core/commandRunner/CommandRunnerImpl.ts index 903650870..c1230aaf3 100644 --- a/packages/cursorless-engine/src/core/commandRunner/CommandRunnerImpl.ts +++ b/packages/cursorless-engine/src/core/commandRunner/CommandRunnerImpl.ts @@ -1,21 +1,24 @@ -import { +import type { ActionDescriptor, CommandComplete, CommandResponse, CommandServerApi, DestinationDescriptor, PartialTargetDescriptor, - clientSupportsFallback, } from "@cursorless/common"; -import { CommandRunner } from "../../CommandRunner"; -import { ActionRecord, ActionReturnValue } from "../../actions/actions.types"; +import { clientSupportsFallback } from "@cursorless/common"; +import type { CommandRunner } from "../../CommandRunner"; +import type { + ActionRecord, + ActionReturnValue, +} from "../../actions/actions.types"; import { parseAndFillOutAction } from "../../customCommandGrammar/parseAndFillOutAction"; -import { StoredTargetMap } from "../../index"; -import { TargetPipelineRunner } from "../../processTargets"; -import { ModifierStage } from "../../processTargets/PipelineStages.types"; -import { SelectionWithEditor } from "../../typings/Types"; -import { Destination, Target } from "../../typings/target.types"; -import { Debug } from "../Debug"; +import type { StoredTargetMap } from "../../index"; +import type { TargetPipelineRunner } from "../../processTargets"; +import type { ModifierStage } from "../../processTargets/PipelineStages.types"; +import type { SelectionWithEditor } from "../../typings/Types"; +import type { Destination, Target } from "../../typings/target.types"; +import type { Debug } from "../Debug"; import { getCommandFallback } from "../getCommandFallback"; import { inferFullTargetDescriptor } from "../inferFullTargetDescriptor"; import { selectionToStoredTarget } from "./selectionToStoredTarget"; diff --git a/packages/cursorless-engine/src/core/commandRunner/selectionToStoredTarget.ts b/packages/cursorless-engine/src/core/commandRunner/selectionToStoredTarget.ts index 3693d891d..b7cdcb053 100644 --- a/packages/cursorless-engine/src/core/commandRunner/selectionToStoredTarget.ts +++ b/packages/cursorless-engine/src/core/commandRunner/selectionToStoredTarget.ts @@ -1,5 +1,5 @@ import { UntypedTarget } from "../../processTargets/targets"; -import { SelectionWithEditor } from "../../typings/Types"; +import type { SelectionWithEditor } from "../../typings/Types"; /** * Given a selection with an editor, constructs an appropriate `Target` to use diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts index 94357035a..0543516e3 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts @@ -1,13 +1,12 @@ -import { +import type { ActionType, Command, CommandComplete, CommandVersion, EnforceUndefined, - LATEST_VERSION, - OutdatedExtensionError, PartialTargetDescriptor, } from "@cursorless/common"; +import { LATEST_VERSION, OutdatedExtensionError } from "@cursorless/common"; import { produce } from "immer"; import { getPartialTargetDescriptors } from "../../util/getPartialTargetDescriptors"; import canonicalizeTargetsInPlace from "./canonicalizeTargetsInPlace"; diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeTargetsInPlace.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeTargetsInPlace.ts index 0e1446dd7..7f6ef4f65 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeTargetsInPlace.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/canonicalizeTargetsInPlace.ts @@ -1,4 +1,4 @@ -import { +import type { HatStyleName, PartialPrimitiveTargetDescriptor, PartialTargetDescriptor, diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV0ToV1/upgradeV0ToV1.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV0ToV1/upgradeV0ToV1.ts index 98973361d..a375fb8dc 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV0ToV1/upgradeV0ToV1.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV0ToV1/upgradeV0ToV1.ts @@ -1,4 +1,4 @@ -import { CommandV0, CommandV1 } from "@cursorless/common"; +import type { CommandV0, CommandV1 } from "@cursorless/common"; export function upgradeV0ToV1(command: CommandV0): CommandV1 { return { ...command, version: 1 }; diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeStrictHere.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeStrictHere.ts index 86c6db64f..6068fdb81 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeStrictHere.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeStrictHere.ts @@ -1,5 +1,5 @@ import { isEqual } from "lodash-es"; -import { PartialPrimitiveTargetDescriptorV2 } from "@cursorless/common"; +import type { PartialPrimitiveTargetDescriptorV2 } from "@cursorless/common"; const STRICT_HERE = { type: "primitive", diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts index 9f0506367..a7dfc5656 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts @@ -1,13 +1,13 @@ -import { ActionType, ActionTypeV2 } from "@cursorless/common"; -import { CommandV2 } from "@cursorless/common"; -import { +import type { ActionType, ActionTypeV2 } from "@cursorless/common"; +import type { CommandV2 } from "@cursorless/common"; +import type { ModifierV2, PartialPrimitiveTargetDescriptorV2, PartialRangeTargetDescriptorV2, PartialTargetDescriptorV2, SimpleScopeTypeTypeV2, } from "@cursorless/common"; -import { +import type { CommandV1, ModifierV0V1, PartialPrimitiveTargetV0V1, diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts index a9ba3311f..89faffc61 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts @@ -1,4 +1,4 @@ -import { +import type { CommandV2, CommandV3, LineNumberMarkV2, diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV3ToV4/upgradeV3ToV4.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV3ToV4/upgradeV3ToV4.ts index 03451092b..d3b444fae 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV3ToV4/upgradeV3ToV4.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV3ToV4/upgradeV3ToV4.ts @@ -1,4 +1,4 @@ -import { +import type { CommandV3, CommandV4, ImplicitTargetDescriptor, diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV4ToV5/upgradeV4ToV5.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV4ToV5/upgradeV4ToV5.ts index 972e7caa5..98116d74d 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV4ToV5/upgradeV4ToV5.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV4ToV5/upgradeV4ToV5.ts @@ -1,4 +1,4 @@ -import { +import type { ActionCommandV4, ActionCommandV5, CommandV4, diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/canonicalizeActionName.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/canonicalizeActionName.ts index 810b7ffe7..4b71f6d85 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/canonicalizeActionName.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/canonicalizeActionName.ts @@ -1,4 +1,5 @@ -import { ActionType, actionNames } from "@cursorless/common"; +import type { ActionType } from "@cursorless/common"; +import { actionNames } from "@cursorless/common"; const actionAliasToCanonicalName: Record = { bring: "replaceWithTarget", diff --git a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/upgradeV5ToV6.ts b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/upgradeV5ToV6.ts index e8747ae5b..6cf2aecff 100644 --- a/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/upgradeV5ToV6.ts +++ b/packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/upgradeV5ToV6.ts @@ -1,4 +1,4 @@ -import { +import type { ActionCommandV5, ActionDescriptor, CommandV5, @@ -26,6 +26,8 @@ import { PrimitiveDestinationDescriptor, ReplaceWith, WrapWithSnippetArg, +} from "@cursorless/common"; +import { type ExecuteCommandOptions, type GetTextActionOptions, } from "@cursorless/common"; diff --git a/packages/cursorless-engine/src/core/compareSnippetDefinitions.ts b/packages/cursorless-engine/src/core/compareSnippetDefinitions.ts index cff4816ec..b10f5e8c5 100644 --- a/packages/cursorless-engine/src/core/compareSnippetDefinitions.ts +++ b/packages/cursorless-engine/src/core/compareSnippetDefinitions.ts @@ -1,9 +1,9 @@ -import { +import type { SimpleScopeTypeType, SnippetDefinition, SnippetScope, } from "@cursorless/common"; -import { SnippetOrigin } from "./mergeSnippets"; +import type { SnippetOrigin } from "./mergeSnippets"; /** * Compares two snippet definitions by how specific their scope, breaking diff --git a/packages/cursorless-engine/src/core/getCommandFallback.ts b/packages/cursorless-engine/src/core/getCommandFallback.ts index 6e6510bbb..e4cfa8283 100644 --- a/packages/cursorless-engine/src/core/getCommandFallback.ts +++ b/packages/cursorless-engine/src/core/getCommandFallback.ts @@ -1,4 +1,4 @@ -import { +import type { ActionDescriptor, CommandComplete, CommandServerApi, diff --git a/packages/cursorless-engine/src/core/handleHoistedModifiers.ts b/packages/cursorless-engine/src/core/handleHoistedModifiers.ts index 4510d32b5..89909b27d 100644 --- a/packages/cursorless-engine/src/core/handleHoistedModifiers.ts +++ b/packages/cursorless-engine/src/core/handleHoistedModifiers.ts @@ -1,6 +1,6 @@ -import { Modifier } from "@cursorless/common"; +import type { Modifier } from "@cursorless/common"; import { findLastIndex } from "lodash-es"; -import { +import type { PrimitiveTargetDescriptor, RangeTargetDescriptor, } from "../typings/TargetDescriptor"; diff --git a/packages/cursorless-engine/src/core/inferFullTargetDescriptor.ts b/packages/cursorless-engine/src/core/inferFullTargetDescriptor.ts index 04991d9f5..3f536401b 100644 --- a/packages/cursorless-engine/src/core/inferFullTargetDescriptor.ts +++ b/packages/cursorless-engine/src/core/inferFullTargetDescriptor.ts @@ -1,4 +1,4 @@ -import { +import type { Modifier, PartialListTargetDescriptor, PartialMark, @@ -6,7 +6,7 @@ import { PartialRangeTargetDescriptor, PartialTargetDescriptor, } from "@cursorless/common"; -import { +import type { ListTargetDescriptor, Mark, PrimitiveTargetDescriptor, diff --git a/packages/cursorless-engine/src/core/mergeSnippets.test.ts b/packages/cursorless-engine/src/core/mergeSnippets.test.ts index c384bf6c0..31a6c8d41 100644 --- a/packages/cursorless-engine/src/core/mergeSnippets.test.ts +++ b/packages/cursorless-engine/src/core/mergeSnippets.test.ts @@ -1,4 +1,4 @@ -import { SnippetMap } from "@cursorless/common"; +import type { SnippetMap } from "@cursorless/common"; import { mergeSnippets } from "./mergeSnippets"; import assert from "assert"; diff --git a/packages/cursorless-engine/src/core/mergeSnippets.ts b/packages/cursorless-engine/src/core/mergeSnippets.ts index 71cec953d..e00bdb088 100644 --- a/packages/cursorless-engine/src/core/mergeSnippets.ts +++ b/packages/cursorless-engine/src/core/mergeSnippets.ts @@ -1,4 +1,4 @@ -import { Snippet, SnippetMap } from "@cursorless/common"; +import type { Snippet, SnippetMap } from "@cursorless/common"; import { cloneDeep, groupBy, mapValues, merge } from "lodash-es"; import { compareSnippetDefinitions } from "./compareSnippetDefinitions"; diff --git a/packages/cursorless-engine/src/core/updateSelections/RangeUpdater.ts b/packages/cursorless-engine/src/core/updateSelections/RangeUpdater.ts index 01ed145f3..d8db28674 100644 --- a/packages/cursorless-engine/src/core/updateSelections/RangeUpdater.ts +++ b/packages/cursorless-engine/src/core/updateSelections/RangeUpdater.ts @@ -7,7 +7,7 @@ import type { } from "@cursorless/common"; import { pull } from "lodash-es"; import { ide } from "../../singletons/ide.singleton"; -import { +import type { ExtendedTextDocumentChangeEvent, FullRangeInfo, } from "../../typings/updateSelections"; diff --git a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts index 4dcd541cb..e52765dc7 100644 --- a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts +++ b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -1,6 +1,9 @@ import { invariant } from "immutability-helper"; -import { ChangeEventInfo, FullRangeInfo } from "../../typings/updateSelections"; -import { RangeOffsets } from "@cursorless/common"; +import type { + ChangeEventInfo, + FullRangeInfo, +} from "../../typings/updateSelections"; +import type { RangeOffsets } from "@cursorless/common"; /** * Gets updated offsets for the range `rangeInfo` after the change described by diff --git a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts index a74b12ad0..6c70a488f 100644 --- a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts +++ b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts @@ -1,6 +1,10 @@ -import { RangeOffsets, leftAnchored, rightAnchored } from "@cursorless/common"; +import type { RangeOffsets } from "@cursorless/common"; +import { leftAnchored, rightAnchored } from "@cursorless/common"; import { invariant } from "immutability-helper"; -import { ChangeEventInfo, FullRangeInfo } from "../../typings/updateSelections"; +import type { + ChangeEventInfo, + FullRangeInfo, +} from "../../typings/updateSelections"; /** * Gets updated offsets for the range `rangeInfo` after the change described by diff --git a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts index 5e496930b..acb0cbe38 100644 --- a/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts +++ b/packages/cursorless-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts @@ -1,6 +1,10 @@ -import { RangeOffsets, leftAnchored, rightAnchored } from "@cursorless/common"; +import type { RangeOffsets } from "@cursorless/common"; +import { leftAnchored, rightAnchored } from "@cursorless/common"; import { invariant } from "immutability-helper"; -import { ChangeEventInfo, FullRangeInfo } from "../../typings/updateSelections"; +import type { + ChangeEventInfo, + FullRangeInfo, +} from "../../typings/updateSelections"; /** * Gets updated offsets for the range `rangeInfo` after the change described by diff --git a/packages/cursorless-engine/src/core/updateSelections/getUpdatedText.ts b/packages/cursorless-engine/src/core/updateSelections/getUpdatedText.ts index edefea71f..6621f3d82 100644 --- a/packages/cursorless-engine/src/core/updateSelections/getUpdatedText.ts +++ b/packages/cursorless-engine/src/core/updateSelections/getUpdatedText.ts @@ -1,5 +1,8 @@ -import { ChangeEventInfo, FullRangeInfo } from "../../typings/updateSelections"; -import { RangeOffsets } from "@cursorless/common"; +import type { + ChangeEventInfo, + FullRangeInfo, +} from "../../typings/updateSelections"; +import type { RangeOffsets } from "@cursorless/common"; /** * Updates the text of the given rangeInfo to take into account the given change. diff --git a/packages/cursorless-engine/src/core/updateSelections/updateRangeInfos.ts b/packages/cursorless-engine/src/core/updateSelections/updateRangeInfos.ts index af0c85390..0f3488aa8 100644 --- a/packages/cursorless-engine/src/core/updateSelections/updateRangeInfos.ts +++ b/packages/cursorless-engine/src/core/updateSelections/updateRangeInfos.ts @@ -2,12 +2,12 @@ import { sumBy } from "lodash-es"; import getOffsetsForDeleteOrReplace from "./getOffsetsForDeleteOrReplace"; import getOffsetsForEmptyRangeInsert from "./getOffsetsForEmptyRangeInsert"; import getOffsetsForNonEmptyRangeInsert from "./getOffsetsForNonEmptyRangeInsert"; -import { +import type { ExtendedTextDocumentChangeEvent, FullRangeInfo, ChangeEventInfo, } from "../../typings/updateSelections"; -import { RangeOffsets } from "@cursorless/common"; +import type { RangeOffsets } from "@cursorless/common"; import { getUpdatedText } from "./getUpdatedText"; /** diff --git a/packages/cursorless-engine/src/core/updateSelections/updateSelections.ts b/packages/cursorless-engine/src/core/updateSelections/updateSelections.ts index d5cfbe6c6..fc863a9c4 100644 --- a/packages/cursorless-engine/src/core/updateSelections/updateSelections.ts +++ b/packages/cursorless-engine/src/core/updateSelections/updateSelections.ts @@ -1,19 +1,21 @@ -import { +import type { Edit, EditableTextEditor, Range, + TextDocument, +} from "@cursorless/common"; +import { RangeExpansionBehavior, Selection, - TextDocument, unsafeKeys, } from "@cursorless/common"; import { flatten } from "lodash-es"; -import { +import type { FullSelectionInfo, SelectionInfo, } from "../../typings/updateSelections"; import { performDocumentEdits } from "../../util/performDocumentEdits"; -import { RangeUpdater } from "./RangeUpdater"; +import type { RangeUpdater } from "./RangeUpdater"; /** Selections OR ranges */ type SelectionsOrRanges = readonly Selection[] | readonly Range[]; diff --git a/packages/cursorless-engine/src/cursorlessEngine.ts b/packages/cursorless-engine/src/cursorlessEngine.ts index bdbb4bc04..fb9d7dd86 100644 --- a/packages/cursorless-engine/src/cursorlessEngine.ts +++ b/packages/cursorless-engine/src/cursorlessEngine.ts @@ -1,16 +1,18 @@ -import { +import type { Command, CommandServerApi, Hats, IDE, ScopeProvider, +} from "@cursorless/common"; +import { ensureCommandShape, type RawTreeSitterQueryProvider, type TalonSpokenForms, type TreeSitter, } from "@cursorless/common"; import { KeyboardTargetUpdater } from "./KeyboardTargetUpdater"; -import { +import type { CommandRunnerDecorator, CursorlessEngine, } from "./api/CursorlessEngineApi"; diff --git a/packages/cursorless-engine/src/customCommandGrammar/fillPlaceholders.ts b/packages/cursorless-engine/src/customCommandGrammar/fillPlaceholders.ts index 0d03f7027..2ff5e0d1c 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/fillPlaceholders.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/fillPlaceholders.ts @@ -1,5 +1,5 @@ import { indexArrayStrict } from "../core/indexArrayStrict"; -import { Placeholder, WithPlaceholders } from "./WithPlaceholders"; +import type { Placeholder, WithPlaceholders } from "./WithPlaceholders"; /** * Given an input with placeholders, fills in the placeholders with the given diff --git a/packages/cursorless-engine/src/customCommandGrammar/grammarAction.test.ts b/packages/cursorless-engine/src/customCommandGrammar/grammarAction.test.ts index e5fd63b68..42135292b 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/grammarAction.test.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/grammarAction.test.ts @@ -1,7 +1,7 @@ import { type ActionDescriptor } from "@cursorless/common"; import assert from "assert"; import { parseAction } from "./parseCommand"; -import { WithPlaceholders } from "./WithPlaceholders"; +import type { WithPlaceholders } from "./WithPlaceholders"; interface TestCase { input: string; diff --git a/packages/cursorless-engine/src/customCommandGrammar/grammarScopeType.test.ts b/packages/cursorless-engine/src/customCommandGrammar/grammarScopeType.test.ts index c85843163..0eb6f4ada 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/grammarScopeType.test.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/grammarScopeType.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { ScopeType } from "@cursorless/common"; +import type { ScopeType } from "@cursorless/common"; import { parseScopeType } from "./parseCommand"; interface TestCase { diff --git a/packages/cursorless-engine/src/customCommandGrammar/grammarUtil.ts b/packages/cursorless-engine/src/customCommandGrammar/grammarUtil.ts index 3fce5baf2..58b7798b7 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/grammarUtil.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/grammarUtil.ts @@ -1,4 +1,4 @@ -import { +import type { BringMoveActionDescriptor, DestinationDescriptor, InsertionMode, @@ -6,6 +6,8 @@ import { PartialRangeTargetDescriptor, PartialTargetMark, PrimitiveDestinationDescriptor, +} from "@cursorless/common"; +import { type ContainingScopeModifier, type Modifier, type PartialMark, @@ -20,7 +22,7 @@ import { type SurroundingPairName, type SurroundingPairScopeType, } from "@cursorless/common"; -import { WithPlaceholders } from "./WithPlaceholders"; +import type { WithPlaceholders } from "./WithPlaceholders"; export function simpleActionDescriptor( name: SimpleActionName, diff --git a/packages/cursorless-engine/src/customCommandGrammar/lexer.test.ts b/packages/cursorless-engine/src/customCommandGrammar/lexer.test.ts index 96ecdb67a..59f559eb7 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/lexer.test.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/lexer.test.ts @@ -1,6 +1,6 @@ import * as assert from "assert"; import { unitTestSetup } from "../test/unitTestSetup"; -import { NearleyLexer, NearleyToken } from "./CommandLexer"; +import type { NearleyLexer, NearleyToken } from "./CommandLexer"; import { lexer } from "./lexer"; interface Fixture { diff --git a/packages/cursorless-engine/src/customCommandGrammar/lexer.ts b/packages/cursorless-engine/src/customCommandGrammar/lexer.ts index f21fe8ffe..72130db14 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/lexer.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/lexer.ts @@ -1,6 +1,8 @@ -import { +import type { BringMoveActionDescriptor, InsertionMode, +} from "@cursorless/common"; +import { simpleActionNames, simpleScopeTypeTypes, surroundingPairNames, diff --git a/packages/cursorless-engine/src/customCommandGrammar/parseAndFillOutAction.ts b/packages/cursorless-engine/src/customCommandGrammar/parseAndFillOutAction.ts index 8c6291138..e141f5749 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/parseAndFillOutAction.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/parseAndFillOutAction.ts @@ -1,4 +1,4 @@ -import { ActionDescriptor } from "@cursorless/common"; +import type { ActionDescriptor } from "@cursorless/common"; import { fillPlaceholders } from "./fillPlaceholders"; import { parseAction } from "./parseCommand"; diff --git a/packages/cursorless-engine/src/customCommandGrammar/parseCommand.ts b/packages/cursorless-engine/src/customCommandGrammar/parseCommand.ts index 0bad1ce15..26a743541 100644 --- a/packages/cursorless-engine/src/customCommandGrammar/parseCommand.ts +++ b/packages/cursorless-engine/src/customCommandGrammar/parseCommand.ts @@ -1,6 +1,7 @@ -import { ScopeType, type ActionDescriptor } from "@cursorless/common"; +import type { ScopeType } from "@cursorless/common"; +import { type ActionDescriptor } from "@cursorless/common"; import { Grammar, Parser } from "nearley"; -import { WithPlaceholders } from "./WithPlaceholders"; +import type { WithPlaceholders } from "./WithPlaceholders"; import grammar from "./generated/grammar"; function getScopeTypeParser(): Parser { diff --git a/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts b/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts index 5844c5263..a9d164229 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.ts @@ -1,4 +1,4 @@ -import { +import type { ActionType, CommandComplete, Disposable, @@ -6,9 +6,9 @@ import { ScopeType, } from "@cursorless/common"; import { SpokenFormGenerator } from "./generateSpokenForm"; -import { CustomSpokenFormGenerator } from "../api/CursorlessEngineApi"; +import type { CustomSpokenFormGenerator } from "../api/CursorlessEngineApi"; import { CustomSpokenForms } from "../spokenForms/CustomSpokenForms"; -import { TalonSpokenForms } from "@cursorless/common"; +import type { TalonSpokenForms } from "@cursorless/common"; /** * Simple facade that combines the {@link CustomSpokenForms} and diff --git a/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts b/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts index cea28e6f0..40b64f719 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/SpokenFormComponent.ts @@ -1,5 +1,5 @@ -import { SpokenFormMapEntry } from "../spokenForms/SpokenFormMap"; -import { SpokenFormMapKeyTypes, SpokenFormType } from "@cursorless/common"; +import type { SpokenFormMapEntry } from "../spokenForms/SpokenFormMap"; +import type { SpokenFormMapKeyTypes, SpokenFormType } from "@cursorless/common"; /** * A component of a spoken form used internally during spoken form generation. diff --git a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts index 10b56e0d3..f998f6631 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts @@ -1,4 +1,4 @@ -import { PartialMark } from "@cursorless/common"; +import type { PartialMark } from "@cursorless/common"; const hatColors: Record = { blue: "blue", diff --git a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts index 655898ff4..868c6607d 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/modifiers.ts @@ -1,7 +1,7 @@ import { CompositeKeyMap } from "@cursorless/common"; -import { SpeakableSurroundingPairName } from "@cursorless/common"; -import { SpokenFormComponentMap } from "../getSpokenFormComponentMap"; -import { CustomizableSpokenFormComponentForType } from "../SpokenFormComponent"; +import type { SpeakableSurroundingPairName } from "@cursorless/common"; +import type { SpokenFormComponentMap } from "../getSpokenFormComponentMap"; +import type { CustomizableSpokenFormComponentForType } from "../SpokenFormComponent"; import { surroundingPairsDelimiters } from "./surroundingPairsDelimiters"; const surroundingPairDelimiterToName = new CompositeKeyMap< diff --git a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/snippets.ts b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/snippets.ts index 433bce1e6..808d36e52 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/snippets.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/snippets.ts @@ -1,4 +1,4 @@ -import { InsertSnippetArg, WrapWithSnippetArg } from "@cursorless/common"; +import type { InsertSnippetArg, WrapWithSnippetArg } from "@cursorless/common"; import { NoSpokenFormError } from "../NoSpokenFormError"; const insertionSnippets: Record = { diff --git a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts index b04351e2f..900e3a503 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/defaultSpokenForms/surroundingPairsDelimiters.ts @@ -1,4 +1,4 @@ -import { SpeakableSurroundingPairName } from "@cursorless/common"; +import type { SpeakableSurroundingPairName } from "@cursorless/common"; export const surroundingPairsDelimiters: Record< SpeakableSurroundingPairName, diff --git a/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts b/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts index 8d9ce1b4c..ee702a71c 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.test.ts @@ -1,15 +1,13 @@ -import { - TestCaseFixtureLegacy, - serializeTestFixture, - shouldUpdateFixtures, -} from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; +import { serializeTestFixture, shouldUpdateFixtures } from "@cursorless/common"; import { getRecordedTestPaths } from "@cursorless/node-common"; import * as yaml from "js-yaml"; import assert from "node:assert"; import { promises as fsp } from "node:fs"; import { SpokenFormGenerator } from "."; import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; -import { SpokenFormMap, mapSpokenForms } from "../spokenForms/SpokenFormMap"; +import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; +import { mapSpokenForms } from "../spokenForms/SpokenFormMap"; import { defaultSpokenFormInfoMap } from "../spokenForms/defaultSpokenFormMap"; import { getHatMapCommand } from "./getHatMapCommand"; diff --git a/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.ts b/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.ts index 2848b495e..4af33a89a 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/generateSpokenForm.ts @@ -1,4 +1,4 @@ -import { +import type { ActionDescriptor, CommandComplete, DestinationDescriptor, @@ -8,11 +8,11 @@ import { SpokenForm, SpokenFormMapKeyTypes, SpokenFormType, - camelCaseToAllDown, } from "@cursorless/common"; -import { SpokenFormMap } from "../spokenForms/SpokenFormMap"; +import { camelCaseToAllDown } from "@cursorless/common"; +import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; import { NoSpokenFormError } from "./NoSpokenFormError"; -import { SpokenFormComponent } from "./SpokenFormComponent"; +import type { SpokenFormComponent } from "./SpokenFormComponent"; import { connectives } from "./defaultSpokenForms/connectives"; import { surroundingPairDelimitersToSpokenForm } from "./defaultSpokenForms/modifiers"; import { @@ -20,10 +20,8 @@ import { wrapperSnippetToSpokenForm, } from "./defaultSpokenForms/snippets"; import { getRangeConnective } from "./getRangeConnective"; -import { - SpokenFormComponentMap, - getSpokenFormComponentMap, -} from "./getSpokenFormComponentMap"; +import type { SpokenFormComponentMap } from "./getSpokenFormComponentMap"; +import { getSpokenFormComponentMap } from "./getSpokenFormComponentMap"; import { PrimitiveTargetSpokenFormGenerator } from "./primitiveTargetToSpokenForm"; export class SpokenFormGenerator { diff --git a/packages/cursorless-engine/src/generateSpokenForm/getHatMapCommand.ts b/packages/cursorless-engine/src/generateSpokenForm/getHatMapCommand.ts index aea52cbe5..96cdbf34c 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/getHatMapCommand.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/getHatMapCommand.ts @@ -1,8 +1,8 @@ -import { +import type { CommandLatest, PartialPrimitiveTargetDescriptor, - splitKey, } from "@cursorless/common"; +import { splitKey } from "@cursorless/common"; /** * Constructs the command that would have been used as the second command when diff --git a/packages/cursorless-engine/src/generateSpokenForm/getRangeConnective.ts b/packages/cursorless-engine/src/generateSpokenForm/getRangeConnective.ts index 5b0a7a5b4..17bfd6be3 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/getRangeConnective.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/getRangeConnective.ts @@ -1,4 +1,4 @@ -import { PartialRangeType } from "@cursorless/common"; +import type { PartialRangeType } from "@cursorless/common"; import { NoSpokenFormError } from "./NoSpokenFormError"; import { connectives } from "./defaultSpokenForms/connectives"; diff --git a/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts b/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts index 7c78b3ed8..735ecb8ed 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts @@ -1,10 +1,10 @@ -import { SpokenFormMap } from "../spokenForms/SpokenFormMap"; -import { +import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; +import type { PartialSpokenFormTypes, SpokenFormMapKeyTypes, SpokenFormType, } from "@cursorless/common"; -import { CustomizableSpokenFormComponentForType } from "./SpokenFormComponent"; +import type { CustomizableSpokenFormComponentForType } from "./SpokenFormComponent"; /** * A spoken form component map is a map of spoken form types to a map of IDs to diff --git a/packages/cursorless-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts b/packages/cursorless-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts index 53eea9ff4..b0f777402 100644 --- a/packages/cursorless-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts +++ b/packages/cursorless-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts @@ -1,4 +1,4 @@ -import { +import type { LineNumberMark, Modifier, PartialMark, @@ -20,8 +20,8 @@ import { numberToSpokenForm, ordinalToSpokenForm, } from "./defaultSpokenForms/numbers"; -import { SpokenFormComponentMap } from "./getSpokenFormComponentMap"; -import { SpokenFormComponent } from "./SpokenFormComponent"; +import type { SpokenFormComponentMap } from "./getSpokenFormComponentMap"; +import type { SpokenFormComponent } from "./SpokenFormComponent"; export class PrimitiveTargetSpokenFormGenerator { constructor(private spokenFormMap: SpokenFormComponentMap) { diff --git a/packages/cursorless-engine/src/languages/LanguageDefinition.ts b/packages/cursorless-engine/src/languages/LanguageDefinition.ts index c8fc1b32a..25f8ac29f 100644 --- a/packages/cursorless-engine/src/languages/LanguageDefinition.ts +++ b/packages/cursorless-engine/src/languages/LanguageDefinition.ts @@ -1,9 +1,11 @@ -import { +import type { RawTreeSitterQueryProvider, ScopeType, SimpleScopeType, SimpleScopeTypeType, TreeSitter, +} from "@cursorless/common"; +import { matchAll, showError, type IDE, diff --git a/packages/cursorless-engine/src/languages/LanguageDefinitions.ts b/packages/cursorless-engine/src/languages/LanguageDefinitions.ts index 1c789d72c..53e704569 100644 --- a/packages/cursorless-engine/src/languages/LanguageDefinitions.ts +++ b/packages/cursorless-engine/src/languages/LanguageDefinitions.ts @@ -1,8 +1,6 @@ +import type { Disposable, Range, TextDocument } from "@cursorless/common"; import { - Disposable, Notifier, - Range, - TextDocument, showError, type IDE, type Listener, diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/PredicateOperatorSchemaTypes.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/PredicateOperatorSchemaTypes.ts index ed9b25e4e..0497810c5 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/PredicateOperatorSchemaTypes.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/PredicateOperatorSchemaTypes.ts @@ -1,9 +1,9 @@ -import { z } from "zod"; -import { +import type { z } from "zod"; +import type { SchemaInputType, SchemaOutputType, } from "./operatorArgumentSchemaTypes"; -import { MutableQueryCapture } from "./QueryCapture"; +import type { MutableQueryCapture } from "./QueryCapture"; /** * A schema used to validate a list of operands for a given predicate operator. diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryCapture.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryCapture.ts index e8a65733f..9df81fa3d 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryCapture.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryCapture.ts @@ -1,5 +1,5 @@ -import { Range, TextDocument } from "@cursorless/common"; -import { Point } from "web-tree-sitter"; +import type { Range, TextDocument } from "@cursorless/common"; +import type { Point } from "web-tree-sitter"; /** * Simple representation of the tree sitter syntax node. Used by diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts index aa2436a17..5f35af593 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts @@ -1,11 +1,11 @@ -import { PredicateOperand } from "web-tree-sitter"; -import { z } from "zod"; -import { +import type { PredicateOperand } from "web-tree-sitter"; +import type { z } from "zod"; +import type { AcceptFunctionArgs, HasSchema, InferSchemaType, } from "./PredicateOperatorSchemaTypes"; -import { MutableQueryMatch } from "./QueryCapture"; +import type { MutableQueryMatch } from "./QueryCapture"; import { constructZodErrorMessages } from "./constructZodErrorMessages"; /** diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts index eecb6f956..9db14b000 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts @@ -1,14 +1,14 @@ -import { - Position, - TextDocument, - showError, - type TreeSitter, -} from "@cursorless/common"; +import type { Position, TextDocument } from "@cursorless/common"; +import { showError, type TreeSitter } from "@cursorless/common"; import { groupBy, uniq } from "lodash-es"; -import { Point, Query } from "web-tree-sitter"; +import type { Point, Query } from "web-tree-sitter"; import { ide } from "../../singletons/ide.singleton"; import { getNodeRange } from "../../util/nodeSelectors"; -import { MutableQueryMatch, QueryCapture, QueryMatch } from "./QueryCapture"; +import type { + MutableQueryMatch, + QueryCapture, + QueryMatch, +} from "./QueryCapture"; import { checkCaptureStartEnd } from "./checkCaptureStartEnd"; import { isContainedInErrorNode } from "./isContainedInErrorNode"; import { parsePredicates } from "./parsePredicates"; diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts index 8285a90c5..f04609674 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts @@ -1,5 +1,6 @@ -import { Messages, Range } from "@cursorless/common"; -import { QueryCapture } from "./QueryCapture"; +import type { Messages } from "@cursorless/common"; +import { Range } from "@cursorless/common"; +import type { QueryCapture } from "./QueryCapture"; import { checkCaptureStartEnd } from "./checkCaptureStartEnd"; import assert from "assert"; diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.ts index 78fa5c037..da10b200f 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.ts @@ -1,5 +1,6 @@ -import { Messages, showError } from "@cursorless/common"; -import { QueryCapture } from "./QueryCapture"; +import type { Messages } from "@cursorless/common"; +import { showError } from "@cursorless/common"; +import type { QueryCapture } from "./QueryCapture"; /** * Checks the captures for a single name to ensure that they are valid. Detects diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/constructZodErrorMessages.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/constructZodErrorMessages.ts index f2889b3d1..df881d7e1 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/constructZodErrorMessages.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/constructZodErrorMessages.ts @@ -1,5 +1,5 @@ -import { PredicateOperand } from "web-tree-sitter"; -import { z } from "zod"; +import type { PredicateOperand } from "web-tree-sitter"; +import type { z } from "zod"; import { operandToString } from "./predicateToString"; export function constructZodErrorMessages( diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts index bd068d453..b3835dda4 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts @@ -1,6 +1,6 @@ import { z } from "zod"; import { assertTypesEqual } from "./assertTypesEqual"; -import { PredicateOperand } from "web-tree-sitter"; +import type { PredicateOperand } from "web-tree-sitter"; const string = z.object({ type: z.literal("string"), value: z.string() }); diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts index 0032a8273..a19c66673 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; import { parsePredicates } from "./parsePredicates"; -import { PredicateResult } from "web-tree-sitter"; +import type { PredicateResult } from "web-tree-sitter"; const predicates: PredicateResult[][] = [ [ diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.ts index 04ddbae4d..65494ddc4 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/parsePredicates.ts @@ -1,5 +1,5 @@ -import { PredicateResult } from "web-tree-sitter"; -import { MutableQueryMatch } from "./QueryCapture"; +import type { PredicateResult } from "web-tree-sitter"; +import type { MutableQueryMatch } from "./QueryCapture"; import { queryPredicateOperators } from "./queryPredicateOperators"; /** diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/predicateToString.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/predicateToString.ts index 6b9f0bc92..c07a2e941 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/predicateToString.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/predicateToString.ts @@ -1,4 +1,4 @@ -import { PredicateOperand, PredicateResult } from "web-tree-sitter"; +import type { PredicateOperand, PredicateResult } from "web-tree-sitter"; export function predicateToString( predicateDescriptor: PredicateResult, diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts index 8814a46c8..143edece3 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts @@ -1,7 +1,7 @@ import { Range, adjustPosition } from "@cursorless/common"; import { z } from "zod"; import { makeRangeFromPositions } from "../../util/nodeSelectors"; -import { MutableQueryCapture } from "./QueryCapture"; +import type { MutableQueryCapture } from "./QueryCapture"; import { QueryPredicateOperator } from "./QueryPredicateOperator"; import { q } from "./operatorArgumentSchemaTypes"; diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts index e8f87277d..5d3376d9e 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts @@ -1,6 +1,7 @@ -import { Range, TextDocument } from "@cursorless/common"; -import { SyntaxNode } from "web-tree-sitter"; -import { MutableQueryCapture } from "./QueryCapture"; +import type { TextDocument } from "@cursorless/common"; +import { Range } from "@cursorless/common"; +import type { SyntaxNode } from "web-tree-sitter"; +import type { MutableQueryCapture } from "./QueryCapture"; import { rewriteStartOfEndOf } from "./rewriteStartOfEndOf"; import assert from "assert"; diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts index bdc8b65d2..463ba9a15 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts @@ -1,4 +1,4 @@ -import { MutableQueryCapture } from "./QueryCapture"; +import type { MutableQueryCapture } from "./QueryCapture"; /** * Modifies captures by applying any `.startOf` or `.endOf` suffixes. For diff --git a/packages/cursorless-engine/src/languages/clojure.ts b/packages/cursorless-engine/src/languages/clojure.ts index 112d9bd68..ed87759de 100644 --- a/packages/cursorless-engine/src/languages/clojure.ts +++ b/packages/cursorless-engine/src/languages/clojure.ts @@ -5,8 +5,8 @@ import { matcher, patternMatcher, } from "../util/nodeMatchers"; -import { NodeMatcherAlternative, NodeFinder } from "../typings/Types"; -import { SimpleScopeTypeType } from "@cursorless/common"; +import type { NodeMatcherAlternative, NodeFinder } from "../typings/Types"; +import type { SimpleScopeTypeType } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; import { delimitedSelector } from "../util/nodeSelectors"; import { identity } from "lodash-es"; diff --git a/packages/cursorless-engine/src/languages/elseIfExtractor.ts b/packages/cursorless-engine/src/languages/elseIfExtractor.ts index 1cf9db0f8..171a3189e 100644 --- a/packages/cursorless-engine/src/languages/elseIfExtractor.ts +++ b/packages/cursorless-engine/src/languages/elseIfExtractor.ts @@ -1,6 +1,10 @@ -import { Selection, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Selection } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { SelectionExtractor, SelectionWithContext } from "../typings/Types"; +import type { + SelectionExtractor, + SelectionWithContext, +} from "../typings/Types"; import { childRangeSelector, positionFromPoint, diff --git a/packages/cursorless-engine/src/languages/getNodeMatcher.ts b/packages/cursorless-engine/src/languages/getNodeMatcher.ts index edbb05c27..fb68c5ed0 100644 --- a/packages/cursorless-engine/src/languages/getNodeMatcher.ts +++ b/packages/cursorless-engine/src/languages/getNodeMatcher.ts @@ -1,7 +1,7 @@ import { UnsupportedLanguageError } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { SimpleScopeTypeType } from "@cursorless/common"; -import { +import type { SimpleScopeTypeType } from "@cursorless/common"; +import type { NodeMatcher, NodeMatcherValue, SelectionWithEditor, @@ -9,7 +9,7 @@ import { import { notSupported } from "../util/nodeMatchers"; import { selectionWithEditorFromRange } from "../util/selectionUtils"; import clojure from "./clojure"; -import { LegacyLanguageId } from "./LegacyLanguageId"; +import type { LegacyLanguageId } from "./LegacyLanguageId"; import latex from "./latex"; import { patternMatchers as ruby } from "./ruby"; import rust from "./rust"; diff --git a/packages/cursorless-engine/src/languages/latex.ts b/packages/cursorless-engine/src/languages/latex.ts index c88674c7d..46bb4e0c5 100644 --- a/packages/cursorless-engine/src/languages/latex.ts +++ b/packages/cursorless-engine/src/languages/latex.ts @@ -1,11 +1,10 @@ -import { - Range, - Selection, - SimpleScopeTypeType, - TextEditor, -} from "@cursorless/common"; +import type { SimpleScopeTypeType, TextEditor } from "@cursorless/common"; +import { Range, Selection } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { NodeMatcherAlternative, SelectionWithContext } from "../typings/Types"; +import type { + NodeMatcherAlternative, + SelectionWithContext, +} from "../typings/Types"; import { patternFinder } from "../util/nodeFinders"; import { ancestorChainNodeMatcher, diff --git a/packages/cursorless-engine/src/languages/ruby.ts b/packages/cursorless-engine/src/languages/ruby.ts index e7a4278bd..ba186c318 100644 --- a/packages/cursorless-engine/src/languages/ruby.ts +++ b/packages/cursorless-engine/src/languages/ruby.ts @@ -1,6 +1,6 @@ -import { SimpleScopeTypeType } from "@cursorless/common"; +import type { SimpleScopeTypeType } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { NodeMatcherAlternative } from "../typings/Types"; +import type { NodeMatcherAlternative } from "../typings/Types"; import { patternFinder } from "../util/nodeFinders"; import { ancestorChainNodeMatcher, diff --git a/packages/cursorless-engine/src/languages/rust.ts b/packages/cursorless-engine/src/languages/rust.ts index 6ba8381dd..21f1d5186 100644 --- a/packages/cursorless-engine/src/languages/rust.ts +++ b/packages/cursorless-engine/src/languages/rust.ts @@ -1,7 +1,10 @@ -import { TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { SimpleScopeTypeType } from "@cursorless/common"; -import { NodeMatcherAlternative, SelectionWithContext } from "../typings/Types"; +import type { SimpleScopeTypeType } from "@cursorless/common"; +import type { + NodeMatcherAlternative, + SelectionWithContext, +} from "../typings/Types"; import { patternFinder } from "../util/nodeFinders"; import { ancestorChainNodeMatcher, diff --git a/packages/cursorless-engine/src/languages/scala.ts b/packages/cursorless-engine/src/languages/scala.ts index 4a9f9d0f7..25bbf0405 100644 --- a/packages/cursorless-engine/src/languages/scala.ts +++ b/packages/cursorless-engine/src/languages/scala.ts @@ -1,5 +1,5 @@ -import { SimpleScopeTypeType } from "@cursorless/common"; -import { NodeMatcherAlternative } from "../typings/Types"; +import type { SimpleScopeTypeType } from "@cursorless/common"; +import type { NodeMatcherAlternative } from "../typings/Types"; import { patternFinder } from "../util/nodeFinders"; import { argumentMatcher, diff --git a/packages/cursorless-engine/src/languages/scss.ts b/packages/cursorless-engine/src/languages/scss.ts index 549fa8978..f4d3e718f 100644 --- a/packages/cursorless-engine/src/languages/scss.ts +++ b/packages/cursorless-engine/src/languages/scss.ts @@ -1,6 +1,6 @@ import type { SyntaxNode } from "web-tree-sitter"; -import { SimpleScopeTypeType } from "@cursorless/common"; -import { +import type { SimpleScopeTypeType } from "@cursorless/common"; +import type { NodeMatcherAlternative, NodeMatcherValue, SelectionWithEditor, diff --git a/packages/cursorless-engine/src/processTargets/MarkStageFactory.ts b/packages/cursorless-engine/src/processTargets/MarkStageFactory.ts index 710ef6e72..98245181c 100644 --- a/packages/cursorless-engine/src/processTargets/MarkStageFactory.ts +++ b/packages/cursorless-engine/src/processTargets/MarkStageFactory.ts @@ -1,5 +1,5 @@ -import { Mark } from "../typings/TargetDescriptor"; -import { MarkStage } from "./PipelineStages.types"; +import type { Mark } from "../typings/TargetDescriptor"; +import type { MarkStage } from "./PipelineStages.types"; export interface MarkStageFactory { create(mark: Mark): MarkStage; diff --git a/packages/cursorless-engine/src/processTargets/MarkStageFactoryImpl.ts b/packages/cursorless-engine/src/processTargets/MarkStageFactoryImpl.ts index 218808d49..97b884dea 100644 --- a/packages/cursorless-engine/src/processTargets/MarkStageFactoryImpl.ts +++ b/packages/cursorless-engine/src/processTargets/MarkStageFactoryImpl.ts @@ -1,9 +1,9 @@ -import { ReadOnlyHatMap } from "@cursorless/common"; -import { TargetPipelineRunner } from "."; -import { StoredTargetMap } from ".."; -import { Mark } from "../typings/TargetDescriptor"; -import { MarkStageFactory } from "./MarkStageFactory"; -import { MarkStage } from "./PipelineStages.types"; +import type { ReadOnlyHatMap } from "@cursorless/common"; +import type { TargetPipelineRunner } from "."; +import type { StoredTargetMap } from ".."; +import type { Mark } from "../typings/TargetDescriptor"; +import type { MarkStageFactory } from "./MarkStageFactory"; +import type { MarkStage } from "./PipelineStages.types"; import { CursorStage } from "./marks/CursorStage"; import { DecoratedSymbolStage } from "./marks/DecoratedSymbolStage"; import { ExplicitMarkStage } from "./marks/ExplicitMarkStage"; diff --git a/packages/cursorless-engine/src/processTargets/ModifierStageFactory.ts b/packages/cursorless-engine/src/processTargets/ModifierStageFactory.ts index 35709141b..d02f0e839 100644 --- a/packages/cursorless-engine/src/processTargets/ModifierStageFactory.ts +++ b/packages/cursorless-engine/src/processTargets/ModifierStageFactory.ts @@ -1,9 +1,9 @@ -import { +import type { ContainingScopeModifier, EveryScopeModifier, Modifier, } from "@cursorless/common"; -import { ModifierStage } from "./PipelineStages.types"; +import type { ModifierStage } from "./PipelineStages.types"; export interface ModifierStageFactory { create(modifier: Modifier): ModifierStage; diff --git a/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts b/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts index d27de1e8c..b52e910ba 100644 --- a/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts +++ b/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts @@ -1,12 +1,12 @@ -import { +import type { ContainingScopeModifier, EveryScopeModifier, Modifier, } from "@cursorless/common"; -import { StoredTargetMap } from "../core/StoredTargets"; -import { LanguageDefinitions } from "../languages/LanguageDefinitions"; -import { ModifierStageFactory } from "./ModifierStageFactory"; -import { ModifierStage } from "./PipelineStages.types"; +import type { StoredTargetMap } from "../core/StoredTargets"; +import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; +import type { ModifierStageFactory } from "./ModifierStageFactory"; +import type { ModifierStage } from "./PipelineStages.types"; import { CascadingStage } from "./modifiers/CascadingStage"; import { ModifyIfUntypedStage } from "./modifiers/ConditionalModifierStages"; import { ContainingScopeStage } from "./modifiers/ContainingScopeStage"; @@ -29,12 +29,12 @@ import { RangeModifierStage } from "./modifiers/RangeModifierStage"; import { RawSelectionStage } from "./modifiers/RawSelectionStage"; import { RelativeScopeStage } from "./modifiers/RelativeScopeStage"; import { VisibleStage } from "./modifiers/VisibleStage"; -import { ScopeHandlerFactory } from "./modifiers/scopeHandlers/ScopeHandlerFactory"; -import { - LegacyContainingSyntaxScopeStage, +import type { ScopeHandlerFactory } from "./modifiers/scopeHandlers/ScopeHandlerFactory"; +import type { SimpleContainingScopeModifier, SimpleEveryScopeModifier, } from "./modifiers/scopeTypeStages/LegacyContainingSyntaxScopeStage"; +import { LegacyContainingSyntaxScopeStage } from "./modifiers/scopeTypeStages/LegacyContainingSyntaxScopeStage"; import { NotebookCellStage } from "./modifiers/scopeTypeStages/NotebookCellStage"; export class ModifierStageFactoryImpl implements ModifierStageFactory { diff --git a/packages/cursorless-engine/src/processTargets/PipelineStages.types.ts b/packages/cursorless-engine/src/processTargets/PipelineStages.types.ts index 77135c24c..a2068d38e 100644 --- a/packages/cursorless-engine/src/processTargets/PipelineStages.types.ts +++ b/packages/cursorless-engine/src/processTargets/PipelineStages.types.ts @@ -1,4 +1,4 @@ -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; export interface MarkStage { run(): Target[]; diff --git a/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts b/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts index 83d140aa5..7491f8cde 100644 --- a/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts +++ b/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts @@ -1,21 +1,20 @@ -import { +import type { Direction, ImplicitTargetDescriptor, Modifier, - Range, ScopeType, - uniqWithHash, } from "@cursorless/common"; +import { Range, uniqWithHash } from "@cursorless/common"; import { zip } from "lodash-es"; -import { +import type { PrimitiveTargetDescriptor, RangeTargetDescriptor, TargetDescriptor, } from "../typings/TargetDescriptor"; -import { Target } from "../typings/target.types"; -import { MarkStageFactory } from "./MarkStageFactory"; -import { ModifierStageFactory } from "./ModifierStageFactory"; -import { MarkStage, ModifierStage } from "./PipelineStages.types"; +import type { Target } from "../typings/target.types"; +import type { MarkStageFactory } from "./MarkStageFactory"; +import type { ModifierStageFactory } from "./ModifierStageFactory"; +import type { MarkStage, ModifierStage } from "./PipelineStages.types"; import { createContinuousRangeTarget } from "./createContinuousRangeTarget"; import { ImplicitStage } from "./marks/ImplicitStage"; import { ContainingTokenIfUntypedEmptyStage } from "./modifiers/ConditionalModifierStages"; diff --git a/packages/cursorless-engine/src/processTargets/createContinuousRangeTarget.ts b/packages/cursorless-engine/src/processTargets/createContinuousRangeTarget.ts index 70dd63bbf..36b69c7df 100644 --- a/packages/cursorless-engine/src/processTargets/createContinuousRangeTarget.ts +++ b/packages/cursorless-engine/src/processTargets/createContinuousRangeTarget.ts @@ -1,4 +1,4 @@ -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { isSameType } from "../util/typeUtils"; import { createContinuousLineRange, diff --git a/packages/cursorless-engine/src/processTargets/marks/DecoratedSymbolStage.ts b/packages/cursorless-engine/src/processTargets/marks/DecoratedSymbolStage.ts index 6a4c81cbe..313dadb8a 100644 --- a/packages/cursorless-engine/src/processTargets/marks/DecoratedSymbolStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/DecoratedSymbolStage.ts @@ -1,6 +1,6 @@ -import { DecoratedSymbolMark, ReadOnlyHatMap } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { MarkStage } from "../PipelineStages.types"; +import type { DecoratedSymbolMark, ReadOnlyHatMap } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { MarkStage } from "../PipelineStages.types"; import { UntypedTarget } from "../targets"; export class DecoratedSymbolStage implements MarkStage { diff --git a/packages/cursorless-engine/src/processTargets/marks/ExplicitMarkStage.ts b/packages/cursorless-engine/src/processTargets/marks/ExplicitMarkStage.ts index eb030305e..e3c1b2f5e 100644 --- a/packages/cursorless-engine/src/processTargets/marks/ExplicitMarkStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/ExplicitMarkStage.ts @@ -1,6 +1,7 @@ -import { ExplicitMark, Range } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { MarkStage } from "../PipelineStages.types"; +import type { ExplicitMark } from "@cursorless/common"; +import { Range } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { MarkStage } from "../PipelineStages.types"; import { UntypedTarget } from "../targets"; import { ide } from "../../singletons/ide.singleton"; diff --git a/packages/cursorless-engine/src/processTargets/marks/LineNumberStage.ts b/packages/cursorless-engine/src/processTargets/marks/LineNumberStage.ts index a9e94de44..e397404f4 100644 --- a/packages/cursorless-engine/src/processTargets/marks/LineNumberStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/LineNumberStage.ts @@ -1,9 +1,9 @@ import type { LineNumberMark, LineNumberType } from "@cursorless/common"; -import { TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; import { ide } from "../../singletons/ide.singleton"; import type { MarkStage } from "../PipelineStages.types"; import { createLineTarget } from "../modifiers/scopeHandlers"; -import { LineTarget } from "../targets"; +import type { LineTarget } from "../targets"; export class LineNumberStage implements MarkStage { constructor(private mark: LineNumberMark) {} diff --git a/packages/cursorless-engine/src/processTargets/marks/NothingStage.ts b/packages/cursorless-engine/src/processTargets/marks/NothingStage.ts index a8f797923..69f8d841f 100644 --- a/packages/cursorless-engine/src/processTargets/marks/NothingStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/NothingStage.ts @@ -1,6 +1,6 @@ -import { Target } from "../../typings/target.types"; -import { NothingMark } from "@cursorless/common"; -import { MarkStage } from "../PipelineStages.types"; +import type { Target } from "../../typings/target.types"; +import type { NothingMark } from "@cursorless/common"; +import type { MarkStage } from "../PipelineStages.types"; export class NothingStage implements MarkStage { constructor(private mark: NothingMark) {} diff --git a/packages/cursorless-engine/src/processTargets/marks/RangeMarkStage.ts b/packages/cursorless-engine/src/processTargets/marks/RangeMarkStage.ts index fb62012e4..22ea4f363 100644 --- a/packages/cursorless-engine/src/processTargets/marks/RangeMarkStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/RangeMarkStage.ts @@ -1,7 +1,7 @@ -import { RangeMark } from "../../typings/TargetDescriptor"; -import { Target } from "../../typings/target.types"; -import { MarkStageFactory } from "../MarkStageFactory"; -import { MarkStage } from "../PipelineStages.types"; +import type { RangeMark } from "../../typings/TargetDescriptor"; +import type { Target } from "../../typings/target.types"; +import type { MarkStageFactory } from "../MarkStageFactory"; +import type { MarkStage } from "../PipelineStages.types"; import { targetsToContinuousTarget } from "../TargetPipelineRunner"; export class RangeMarkStage implements MarkStage { diff --git a/packages/cursorless-engine/src/processTargets/marks/StoredTargetStage.ts b/packages/cursorless-engine/src/processTargets/marks/StoredTargetStage.ts index 17de2f239..1675ed5ad 100644 --- a/packages/cursorless-engine/src/processTargets/marks/StoredTargetStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/StoredTargetStage.ts @@ -1,7 +1,7 @@ -import { StoredTargetKey } from "@cursorless/common"; -import { StoredTargetMap } from "../../core/StoredTargets"; -import { Target } from "../../typings/target.types"; -import { MarkStage } from "../PipelineStages.types"; +import type { StoredTargetKey } from "@cursorless/common"; +import type { StoredTargetMap } from "../../core/StoredTargets"; +import type { Target } from "../../typings/target.types"; +import type { MarkStage } from "../PipelineStages.types"; export class StoredTargetStage implements MarkStage { constructor( diff --git a/packages/cursorless-engine/src/processTargets/marks/TargetMarkStage.ts b/packages/cursorless-engine/src/processTargets/marks/TargetMarkStage.ts index 7a96b6474..1a0746361 100644 --- a/packages/cursorless-engine/src/processTargets/marks/TargetMarkStage.ts +++ b/packages/cursorless-engine/src/processTargets/marks/TargetMarkStage.ts @@ -1,7 +1,7 @@ -import { TargetPipelineRunner } from "../TargetPipelineRunner"; -import { TargetMark } from "../../typings/TargetDescriptor"; -import { Target } from "../../typings/target.types"; -import { MarkStage } from "../PipelineStages.types"; +import type { TargetPipelineRunner } from "../TargetPipelineRunner"; +import type { TargetMark } from "../../typings/TargetDescriptor"; +import type { Target } from "../../typings/target.types"; +import type { MarkStage } from "../PipelineStages.types"; export class TargetMarkStage implements MarkStage { constructor( diff --git a/packages/cursorless-engine/src/processTargets/modifiers/CascadingStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/CascadingStage.ts index 8da5def32..e16d19b7d 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/CascadingStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/CascadingStage.ts @@ -1,7 +1,7 @@ -import { CascadingModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { CascadingModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; /** * Tries each of the given modifiers in turn until one of them doesn't throw an diff --git a/packages/cursorless-engine/src/processTargets/modifiers/ConditionalModifierStages.ts b/packages/cursorless-engine/src/processTargets/modifiers/ConditionalModifierStages.ts index 6b1c80b1f..cbb14cdfe 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/ConditionalModifierStages.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/ConditionalModifierStages.ts @@ -1,7 +1,7 @@ -import { Modifier, ModifyIfUntypedModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { Modifier, ModifyIfUntypedModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; abstract class ConditionalModifierBaseStage implements ModifierStage { private nestedStage_?: ModifierStage; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/ContainingScopeStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/ContainingScopeStage.ts index 270008cc3..41e12f4ef 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/ContainingScopeStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/ContainingScopeStage.ts @@ -1,11 +1,9 @@ -import { - ContainingScopeModifier, - NoContainingScopeError, -} from "@cursorless/common"; +import type { ContainingScopeModifier } from "@cursorless/common"; +import { NoContainingScopeError } from "@cursorless/common"; import type { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import type { ModifierStage } from "../PipelineStages.types"; -import { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; +import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; import { getContainingScopeTarget } from "./getContainingScopeTarget"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/EveryScopeStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/EveryScopeStage.ts index b94bf21e5..8d8f00df8 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/EveryScopeStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/EveryScopeStage.ts @@ -1,12 +1,12 @@ -import type { EveryScopeModifier, TextEditor } from "@cursorless/common"; -import { NoContainingScopeError, Range } from "@cursorless/common"; +import type { EveryScopeModifier, TextEditor, Range } from "@cursorless/common"; +import { NoContainingScopeError } from "@cursorless/common"; import type { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import type { ModifierStage } from "../PipelineStages.types"; import { getContainingScopeTarget } from "./getContainingScopeTarget"; -import { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; -import { TargetScope } from "./scopeHandlers/scope.types"; -import { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; +import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; +import type { TargetScope } from "./scopeHandlers/scope.types"; +import type { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; /** * This modifier returns all scopes intersecting the input target if the target diff --git a/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts index c875ca7da..0e07901ad 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts @@ -1,7 +1,7 @@ -import { HeadModifier, TailModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { HeadModifier, TailModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; import { getModifierStagesFromTargetModifiers, processModifierStages, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts index b3b17df69..40adf0129 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts @@ -1,21 +1,21 @@ -import { +import type { Direction, Modifier, OrdinalScopeModifier, - Range, RelativeScopeModifier, ScopeType, TextEditor, } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { flatmap, ifilter, imap, itake } from "itertools"; import { escapeRegExp } from "lodash-es"; import type { Target } from "../../typings/target.types"; import { generateMatchesInRange } from "../../util/getMatchesInRange"; -import { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import type { ModifierStage } from "../PipelineStages.types"; import { PlainTarget } from "../targets"; import { ContainingTokenIfUntypedEmptyStage } from "./ConditionalModifierStages"; -import { StoredTargetMap } from "../.."; +import type { StoredTargetMap } from "../.."; import { OutOfRangeError } from "./listUtils"; export class InstanceStage implements ModifierStage { diff --git a/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts index 830f25c67..ec1c37508 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts @@ -1,10 +1,10 @@ -import { +import type { ExcludeInteriorModifier, InteriorOnlyModifier, } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; import { ModifyIfConditionStage } from "./ConditionalModifierStages"; export class InteriorOnlyStage implements ModifierStage { diff --git a/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/ItemStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/ItemStage.ts index 7f03939cd..0efea9f7c 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/ItemStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/ItemStage.ts @@ -1,21 +1,18 @@ -import { +import type { ContainingScopeModifier, EveryScopeModifier, - NoContainingScopeError, - Range, SimpleScopeTypeType, TextEditor, } from "@cursorless/common"; -import { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; -import { Target } from "../../../typings/target.types"; +import { NoContainingScopeError, Range } from "@cursorless/common"; +import type { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; +import type { Target } from "../../../typings/target.types"; import { getRangeLength } from "../../../util/rangeUtils"; import type { ModifierStageFactory } from "../../ModifierStageFactory"; -import { ModifierStage } from "../../PipelineStages.types"; +import type { ModifierStage } from "../../PipelineStages.types"; import { ScopeTypeTarget } from "../../targets"; -import { - LegacyContainingSyntaxScopeStage, - SimpleContainingScopeModifier, -} from "../scopeTypeStages/LegacyContainingSyntaxScopeStage"; +import type { SimpleContainingScopeModifier } from "../scopeTypeStages/LegacyContainingSyntaxScopeStage"; +import { LegacyContainingSyntaxScopeStage } from "../scopeTypeStages/LegacyContainingSyntaxScopeStage"; import { getIterationScope } from "./getIterationScope"; import { tokenizeRange } from "./tokenizeRange"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/getIterationScope.ts b/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/getIterationScope.ts index 4a8c0a71f..61fb0b316 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/getIterationScope.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/getIterationScope.ts @@ -1,10 +1,6 @@ -import { - Range, - TextEditor, - TextLine, - type SurroundingPairScopeType, -} from "@cursorless/common"; -import { Target } from "../../../typings/target.types"; +import type { TextEditor, TextLine } from "@cursorless/common"; +import { Range, type SurroundingPairScopeType } from "@cursorless/common"; +import type { Target } from "../../../typings/target.types"; import type { ModifierStageFactory } from "../../ModifierStageFactory"; import { PlainTarget } from "../../targets"; import { fitRangeToLineContent } from "../scopeHandlers"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/tokenizeRange.ts b/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/tokenizeRange.ts index d1003986c..43269862b 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/tokenizeRange.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/ItemStage/tokenizeRange.ts @@ -1,4 +1,5 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Range } from "@cursorless/common"; /** * Given the iteration scope, returns a list of "tokens" within that collection diff --git a/packages/cursorless-engine/src/processTargets/modifiers/LeadingTrailingStages.ts b/packages/cursorless-engine/src/processTargets/modifiers/LeadingTrailingStages.ts index f519e77d8..2bd92a3cc 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/LeadingTrailingStages.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/LeadingTrailingStages.ts @@ -1,7 +1,7 @@ -import { LeadingModifier, TrailingModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { LeadingModifier, TrailingModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; import { containingTokenIfUntypedModifier } from "./commonContainingScopeIfUntypedModifiers"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/OrdinalScopeStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/OrdinalScopeStage.ts index babdcd280..c1396ef5b 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/OrdinalScopeStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/OrdinalScopeStage.ts @@ -1,7 +1,7 @@ -import { OrdinalScopeModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { OrdinalScopeModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; import { createRangeTargetFromIndices, getEveryScopeTargets, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/PositionStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/PositionStage.ts index a76dc163f..875c2fc03 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/PositionStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/PositionStage.ts @@ -1,11 +1,8 @@ -import { Range } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStage } from "../PipelineStages.types"; -import { - CommonTargetParameters, - PlainTarget, - RawSelectionTarget, -} from "../targets"; +import type { Range } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStage } from "../PipelineStages.types"; +import type { CommonTargetParameters } from "../targets"; +import { PlainTarget, RawSelectionTarget } from "../targets"; abstract class PositionStage implements ModifierStage { run(target: Target): Target[] { diff --git a/packages/cursorless-engine/src/processTargets/modifiers/RangeModifierStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/RangeModifierStage.ts index e51b06366..2c91c4b00 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/RangeModifierStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/RangeModifierStage.ts @@ -1,7 +1,7 @@ -import { RangeModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; -import { ModifierStage } from "../PipelineStages.types"; +import type { RangeModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStage } from "../PipelineStages.types"; import { targetsToContinuousTarget } from "../TargetPipelineRunner"; export class RangeModifierStage implements ModifierStage { diff --git a/packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts index 0bd7a14cb..c43c62a00 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/RelativeScopeStage.ts @@ -3,11 +3,11 @@ import { type RelativeScopeModifier, } from "@cursorless/common"; import type { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import type { ModifierStage } from "../PipelineStages.types"; import { runLegacy } from "./relativeScopeLegacy"; -import { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; -import { TargetScope } from "./scopeHandlers/scope.types"; +import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; +import type { TargetScope } from "./scopeHandlers/scope.types"; import type { ContainmentPolicy, ScopeHandler, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/VisibleStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/VisibleStage.ts index f5cd56fdc..da226fde9 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/VisibleStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/VisibleStage.ts @@ -1,6 +1,6 @@ -import { VisibleModifier } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStage } from "../PipelineStages.types"; +import type { VisibleModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStage } from "../PipelineStages.types"; import { PlainTarget } from "../targets"; export class VisibleStage implements ModifierStage { diff --git a/packages/cursorless-engine/src/processTargets/modifiers/commonContainingScopeIfUntypedModifiers.ts b/packages/cursorless-engine/src/processTargets/modifiers/commonContainingScopeIfUntypedModifiers.ts index 38615f18a..43e38995b 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/commonContainingScopeIfUntypedModifiers.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/commonContainingScopeIfUntypedModifiers.ts @@ -1,4 +1,4 @@ -import { Modifier } from "@cursorless/common"; +import type { Modifier } from "@cursorless/common"; // NB: We import `Target` below just so that @link below resolves. Once one of // the following issues are fixed, we can either remove the above line or // switch to `{import("foo")}` syntax in the `{@link}` tag. diff --git a/packages/cursorless-engine/src/processTargets/modifiers/constructScopeRangeTarget.ts b/packages/cursorless-engine/src/processTargets/modifiers/constructScopeRangeTarget.ts index b3fc409ea..a650117c6 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/constructScopeRangeTarget.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/constructScopeRangeTarget.ts @@ -1,6 +1,6 @@ -import { Target } from "../../typings/target.types"; +import type { Target } from "../../typings/target.types"; import { createContinuousRangeTarget } from "../createContinuousRangeTarget"; -import { TargetScope } from "./scopeHandlers/scope.types"; +import type { TargetScope } from "./scopeHandlers/scope.types"; /** * Constructs a target consisting of a range between {@link scope1} and diff --git a/packages/cursorless-engine/src/processTargets/modifiers/getContainingScopeTarget.ts b/packages/cursorless-engine/src/processTargets/modifiers/getContainingScopeTarget.ts index c1b38b610..ffa852105 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/getContainingScopeTarget.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/getContainingScopeTarget.ts @@ -1,8 +1,8 @@ -import { Direction, Position, TextEditor } from "@cursorless/common"; +import type { Direction, Position, TextEditor } from "@cursorless/common"; import type { Target } from "../../typings/target.types"; import { constructScopeRangeTarget } from "./constructScopeRangeTarget"; -import { TargetScope } from "./scopeHandlers/scope.types"; -import { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; +import type { TargetScope } from "./scopeHandlers/scope.types"; +import type { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; import { getPreferredScopeTouchingPosition } from "./getPreferredScopeTouchingPosition"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/getPreferredScopeTouchingPosition.ts b/packages/cursorless-engine/src/processTargets/modifiers/getPreferredScopeTouchingPosition.ts index db0a3b432..40871e41c 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/getPreferredScopeTouchingPosition.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/getPreferredScopeTouchingPosition.ts @@ -1,6 +1,6 @@ -import { Direction, Position, TextEditor } from "@cursorless/common"; -import { TargetScope } from "./scopeHandlers/scope.types"; -import { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; +import type { Direction, Position, TextEditor } from "@cursorless/common"; +import type { TargetScope } from "./scopeHandlers/scope.types"; +import type { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; /** * Returns the preferred scope touching the input position, or undefined if no diff --git a/packages/cursorless-engine/src/processTargets/modifiers/relativeScopeLegacy.ts b/packages/cursorless-engine/src/processTargets/modifiers/relativeScopeLegacy.ts index 7ac4bace2..4cc146a65 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/relativeScopeLegacy.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/relativeScopeLegacy.ts @@ -1,7 +1,7 @@ -import { Range, RelativeScopeModifier } from "@cursorless/common"; +import type { Range, RelativeScopeModifier } from "@cursorless/common"; import { findLastIndex } from "lodash-es"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import { UntypedTarget } from "../targets"; import { createRangeTargetFromIndices, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts index 3e5d89e3d..d2f3f5ada 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts @@ -1,7 +1,8 @@ -import { TextEditor, Position, Direction, Range } from "@cursorless/common"; +import type { TextEditor, Direction } from "@cursorless/common"; +import { Position, Range } from "@cursorless/common"; import { BaseScopeHandler } from "./BaseScopeHandler"; -import { TargetScope } from "./scope.types"; -import { +import type { TargetScope } from "./scope.types"; +import type { CustomScopeType, ScopeIteratorRequirements, } from "./scopeHandler.types"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.ts index aedfd826e..33c9614e9 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.ts @@ -1,6 +1,6 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports import type { Direction, ScopeType } from "@cursorless/common"; -import { Position, TextEditor } from "@cursorless/common"; +import type { Position, TextEditor } from "@cursorless/common"; import type { TargetScope } from "./scope.types"; import type { CustomScopeType, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BoundedScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BoundedScopeHandler.ts index 4f3b7a710..4eacef014 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BoundedScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/BoundedScopeHandler.ts @@ -1,7 +1,12 @@ -import { Direction, Position, ScopeType, TextEditor } from "@cursorless/common"; +import type { + Direction, + Position, + ScopeType, + TextEditor, +} from "@cursorless/common"; +import type { InteriorTarget } from "../../targets"; import { BoundedParagraphTarget, - InteriorTarget, ParagraphTarget, TokenTarget, } from "../../targets"; @@ -13,7 +18,7 @@ import type { ScopeIteratorRequirements, } from "./scopeHandler.types"; import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; -import { Target } from "../../../typings/target.types"; +import type { Target } from "../../../typings/target.types"; abstract class BoundedBaseScopeHandler extends BaseScopeHandler { protected readonly isHierarchical = true; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts index 96d2b5262..2fd80d018 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts @@ -1,4 +1,4 @@ -import { Direction, ScopeType } from "@cursorless/common"; +import type { Direction, ScopeType } from "@cursorless/common"; import { imap } from "itertools"; import { NestedScopeHandler } from "./NestedScopeHandler"; import { getMatcher } from "../../../tokenizer"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/DocumentScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/DocumentScopeHandler.ts index f9391f354..0e40eaa4c 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/DocumentScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/DocumentScopeHandler.ts @@ -1,8 +1,8 @@ -import { TextEditor, Position } from "@cursorless/common"; -import { Direction, ScopeType } from "@cursorless/common"; +import type { TextEditor, Position } from "@cursorless/common"; +import type { Direction, ScopeType } from "@cursorless/common"; import { DocumentTarget } from "../../targets"; import { BaseScopeHandler } from "./BaseScopeHandler"; -import { TargetScope } from "./scope.types"; +import type { TargetScope } from "./scope.types"; export class DocumentScopeHandler extends BaseScopeHandler { public readonly scopeType = { type: "document" } as const; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts index 08c8967bb..87d9a0c57 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts @@ -1,7 +1,7 @@ import { imap } from "itertools"; import { NestedScopeHandler } from "./NestedScopeHandler"; import { getMatcher } from "../../../tokenizer"; -import { Direction } from "@cursorless/common"; +import type { Direction } from "@cursorless/common"; import { generateMatchesInRange } from "../../../util/getMatchesInRange"; import { TokenTarget } from "../../targets"; import type { TargetScope } from "./scope.types"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/LineScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/LineScopeHandler.ts index e57b1094c..899a5fa02 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/LineScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/LineScopeHandler.ts @@ -1,10 +1,10 @@ -import { +import type { Direction, Position, - Range, ScopeType, TextEditor, } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { LineTarget } from "../../targets"; import { BaseScopeHandler } from "./BaseScopeHandler"; import type { TargetScope } from "./scope.types"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts index 6e4d39635..f4a4f1878 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts @@ -1,8 +1,8 @@ import type { Direction, ScopeType } from "@cursorless/common"; -import { Position, TextEditor } from "@cursorless/common"; +import type { Position, TextEditor } from "@cursorless/common"; import { flatmap } from "itertools"; import { BaseScopeHandler } from "./BaseScopeHandler"; -import { ScopeHandlerFactory } from "./ScopeHandlerFactory"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import type { TargetScope } from "./scope.types"; import type { ScopeHandler, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NotHierarchicalScopeError.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NotHierarchicalScopeError.ts index f446feb5c..c3858b16e 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NotHierarchicalScopeError.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/NotHierarchicalScopeError.ts @@ -1,4 +1,4 @@ -import { ScopeType } from "@cursorless/common"; +import type { ScopeType } from "@cursorless/common"; import { scopeTypeToString } from "./scopeTypeUtil"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/OneOfScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/OneOfScopeHandler.ts index ea2d82bb2..d8ad2cdb5 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/OneOfScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/OneOfScopeHandler.ts @@ -1,4 +1,4 @@ -import { +import type { Direction, OneOfScopeType, Position, @@ -6,10 +6,10 @@ import { } from "@cursorless/common"; import { BaseScopeHandler } from "./BaseScopeHandler"; import { advanceIteratorsUntil, getInitialIteratorInfos } from "./IteratorInfo"; -import { ScopeHandlerFactory } from "./ScopeHandlerFactory"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import { compareTargetScopes } from "./compareTargetScopes"; import type { TargetScope } from "./scope.types"; -import { +import type { CustomScopeType, ScopeHandler, ScopeIteratorRequirements, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ParagraphScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ParagraphScopeHandler.ts index d61cdd1f5..49b3c5f2a 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ParagraphScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ParagraphScopeHandler.ts @@ -1,15 +1,15 @@ -import { +import type { Position, Range, TextDocument, TextEditor, TextLine, } from "@cursorless/common"; -import { Direction, ScopeType } from "@cursorless/common"; +import type { Direction, ScopeType } from "@cursorless/common"; import { ParagraphTarget } from "../../targets"; import { BaseScopeHandler } from "./BaseScopeHandler"; import { fitRangeToLineContent } from "./LineScopeHandler"; -import { TargetScope } from "./scope.types"; +import type { TargetScope } from "./scope.types"; export class ParagraphScopeHandler extends BaseScopeHandler { public readonly scopeType: ScopeType = { type: "paragraph" }; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts index 09e29f864..c81449620 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts @@ -1,4 +1,4 @@ -import { +import type { CustomRegexScopeType, Direction, GlyphScopeType, @@ -7,10 +7,10 @@ import { import { imap } from "itertools"; import { escapeRegExp } from "lodash-es"; import { NestedScopeHandler } from "./NestedScopeHandler"; -import { ScopeHandlerFactory } from "./ScopeHandlerFactory"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import { generateMatchesInRange } from "../../../util/getMatchesInRange"; import { TokenTarget } from "../../targets"; -import { TargetScope } from "./scope.types"; +import type { TargetScope } from "./scope.types"; abstract class RegexStageBase extends NestedScopeHandler { public readonly iterationScopeType: ScopeType = { type: "line" }; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts index 73ef97c3a..0d4b4056d 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts @@ -1,5 +1,5 @@ import type { ScopeType } from "@cursorless/common"; -import { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; +import type { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; import { BoundedNonWhitespaceSequenceScopeHandler, BoundedParagraphScopeHandler, @@ -16,7 +16,7 @@ import { NonWhitespaceSequenceScopeHandler, UrlScopeHandler, } from "./RegexScopeHandler"; -import { ScopeHandlerFactory } from "./ScopeHandlerFactory"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import { SentenceScopeHandler } from "./SentenceScopeHandler/SentenceScopeHandler"; import { SurroundingPairInteriorScopeHandler, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts index c97cbaa72..70ca27d27 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts @@ -1,4 +1,5 @@ -import { Direction, MatchedText, Range } from "@cursorless/common"; +import type { Direction, MatchedText } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { imap } from "itertools"; import { TokenTarget } from "../../../targets"; import { NestedScopeHandler } from "../NestedScopeHandler"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts index 6ac2a980f..3fc6497ac 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter.ts @@ -1,8 +1,7 @@ -import { MatchedText, matchRegex, testRegex } from "@cursorless/common"; -import { - SentenceParserOptions, - getSentences, -} from "@cursorless/sentence-parser"; +import type { MatchedText } from "@cursorless/common"; +import { matchRegex, testRegex } from "@cursorless/common"; +import type { SentenceParserOptions } from "@cursorless/sentence-parser"; +import { getSentences } from "@cursorless/sentence-parser"; // A sentence starts with a letter with adjacent leading symbols. Whitespace excluded. const leadingOffsetRegex = /\S*\p{L}/u; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairInteriorScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairInteriorScopeHandler.ts index 631a8346e..850979e86 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairInteriorScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairInteriorScopeHandler.ts @@ -1,15 +1,9 @@ -import { - Direction, - Position, - TextEditor, - type SurroundingPairInteriorScopeType, -} from "@cursorless/common"; +import type { Direction, Position, TextEditor } from "@cursorless/common"; +import { type SurroundingPairInteriorScopeType } from "@cursorless/common"; import { BaseScopeHandler } from "../BaseScopeHandler"; -import { TargetScope } from "../scope.types"; -import { - ScopeIteratorRequirements, - type ScopeHandler, -} from "../scopeHandler.types"; +import type { TargetScope } from "../scope.types"; +import type { ScopeIteratorRequirements } from "../scopeHandler.types"; +import { type ScopeHandler } from "../scopeHandler.types"; import type { ScopeHandlerFactory } from "../ScopeHandlerFactory"; import { map } from "itertools"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts index 55308923c..615873b83 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts @@ -1,22 +1,21 @@ -import { +import type { Direction, Position, SurroundingPairScopeType, TextEditor, - showError, - type ScopeType, } from "@cursorless/common"; +import { showError, type ScopeType } from "@cursorless/common"; import type { LanguageDefinitions } from "../../../../languages/LanguageDefinitions"; import { ide } from "../../../../singletons/ide.singleton"; import { BaseScopeHandler } from "../BaseScopeHandler"; import { compareTargetScopes } from "../compareTargetScopes"; -import { TargetScope } from "../scope.types"; -import { ScopeIteratorRequirements } from "../scopeHandler.types"; +import type { TargetScope } from "../scope.types"; +import type { ScopeIteratorRequirements } from "../scopeHandler.types"; import { createTargetScope } from "./createTargetScope"; import { getDelimiterOccurrences } from "./getDelimiterOccurrences"; import { getIndividualDelimiters } from "./getIndividualDelimiters"; import { getSurroundingPairOccurrences } from "./getSurroundingPairOccurrences"; -import { SurroundingPairOccurrence } from "./types"; +import type { SurroundingPairOccurrence } from "./types"; export class SurroundingPairScopeHandler extends BaseScopeHandler { public readonly iterationScopeType: ScopeType = { type: "line" }; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/createTargetScope.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/createTargetScope.ts index 37a9e1569..e9bba9d1b 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/createTargetScope.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/createTargetScope.ts @@ -1,6 +1,7 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { SurroundingPairTarget } from "../../../targets"; -import { TargetScope } from "../scope.types"; +import type { TargetScope } from "../scope.types"; import type { SurroundingPairOccurrence } from "./types"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts index 4b523b2dc..3b55057c5 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts @@ -1,8 +1,8 @@ -import { +import type { ComplexSurroundingPairName, SimpleSurroundingPairName, - unsafeKeys, } from "@cursorless/common"; +import { unsafeKeys } from "@cursorless/common"; type IndividualDelimiterText = string | string[]; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts index 0789cceaa..c75118fff 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts @@ -1,12 +1,12 @@ +import type { SimpleSurroundingPairName } from "@cursorless/common"; import { - SimpleSurroundingPairName, isString, type ComplexSurroundingPairName, type SurroundingPairName, } from "@cursorless/common"; import { concat, uniq } from "lodash-es"; import { complexDelimiterMap, getSimpleDelimiterMap } from "./delimiterMaps"; -import { IndividualDelimiter } from "./types"; +import type { IndividualDelimiter } from "./types"; /** * Given a list of delimiters, returns a list where each element corresponds to diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts index 1605fdfdb..b1a573877 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts @@ -1,4 +1,5 @@ -import { DefaultMap, SimpleSurroundingPairName } from "@cursorless/common"; +import type { SimpleSurroundingPairName } from "@cursorless/common"; +import { DefaultMap } from "@cursorless/common"; import type { DelimiterOccurrence, SurroundingPairOccurrence } from "./types"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/types.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/types.ts index 59fd3443b..923f0e250 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/types.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/types.ts @@ -1,4 +1,5 @@ -import { SimpleSurroundingPairName, type Range } from "@cursorless/common"; +import type { SimpleSurroundingPairName } from "@cursorless/common"; +import { type Range } from "@cursorless/common"; /** * Used to indicate whether a particular side of the delimiter is left or right diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts index 12b489381..d714640a9 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts @@ -1,4 +1,4 @@ -import { Direction } from "@cursorless/common"; +import type { Direction } from "@cursorless/common"; import { imap } from "itertools"; import { NestedScopeHandler } from "./NestedScopeHandler"; import { getMatcher } from "../../../tokenizer"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts index cb29bd9eb..af4128487 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts @@ -1,11 +1,12 @@ -import { Direction, Position, TextEditor, showError } from "@cursorless/common"; +import type { Direction, Position, TextEditor } from "@cursorless/common"; +import { showError } from "@cursorless/common"; import { uniqWith } from "lodash-es"; -import { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; -import { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; +import type { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; +import type { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; import { BaseScopeHandler } from "../BaseScopeHandler"; import { compareTargetScopes } from "../compareTargetScopes"; -import { TargetScope } from "../scope.types"; -import { ScopeIteratorRequirements } from "../scopeHandler.types"; +import type { TargetScope } from "../scope.types"; +import type { ScopeIteratorRequirements } from "../scopeHandler.types"; import { mergeAdjacentBy } from "./mergeAdjacentBy"; import { ide } from "../../../../singletons/ide.singleton"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterIterationScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterIterationScopeHandler.ts index 7b0a04410..9f5acd1eb 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterIterationScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterIterationScopeHandler.ts @@ -1,11 +1,13 @@ -import { ScopeType, SimpleScopeType, TextEditor } from "@cursorless/common"; -import { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; -import { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; +import type { + ScopeType, + SimpleScopeType, + TextEditor, +} from "@cursorless/common"; +import type { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; +import type { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; import { PlainTarget } from "../../../targets"; -import { - BaseTreeSitterScopeHandler, - ExtendedTargetScope, -} from "./BaseTreeSitterScopeHandler"; +import type { ExtendedTargetScope } from "./BaseTreeSitterScopeHandler"; +import { BaseTreeSitterScopeHandler } from "./BaseTreeSitterScopeHandler"; import { getRelatedCapture, getRelatedRange } from "./captureUtils"; /** Scope handler to be used for iteration scopes of tree-sitter scope types */ diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts index e5d054ee6..36ee018eb 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts @@ -1,12 +1,10 @@ -import { SimpleScopeType, TextEditor } from "@cursorless/common"; -import { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; -import { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; +import type { SimpleScopeType, TextEditor } from "@cursorless/common"; +import type { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; +import type { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; import { ScopeTypeTarget } from "../../../targets/ScopeTypeTarget"; -import { CustomScopeType } from "../scopeHandler.types"; -import { - BaseTreeSitterScopeHandler, - ExtendedTargetScope, -} from "./BaseTreeSitterScopeHandler"; +import type { CustomScopeType } from "../scopeHandler.types"; +import type { ExtendedTargetScope } from "./BaseTreeSitterScopeHandler"; +import { BaseTreeSitterScopeHandler } from "./BaseTreeSitterScopeHandler"; import { TreeSitterIterationScopeHandler } from "./TreeSitterIterationScopeHandler"; import { findCaptureByName, getRelatedRange } from "./captureUtils"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/captureUtils.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/captureUtils.ts index 552e67199..998e9e761 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/captureUtils.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/captureUtils.ts @@ -1,5 +1,5 @@ -import { Range } from "@cursorless/common"; -import { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; +import type { Range } from "@cursorless/common"; +import type { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; /** * Gets a capture that is related to the scope. For example, if the scope is diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts index 037cc0aea..fe2ce3bae 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts @@ -1,7 +1,8 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { NestedScopeHandler } from "../NestedScopeHandler"; import { WordTokenizer } from "./WordTokenizer"; -import { Direction } from "@cursorless/common"; +import type { Direction } from "@cursorless/common"; import { SubTokenWordTarget } from "../../../targets"; import type { TargetScope } from "../scope.types"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/compareTargetScopes.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/compareTargetScopes.ts index 099d7d7ce..11fbb1f0a 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/compareTargetScopes.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/compareTargetScopes.ts @@ -1,6 +1,6 @@ -import { Position, Range } from "@cursorless/common"; -import { Direction } from "@cursorless/common"; -import { TargetScope } from "./scope.types"; +import type { Position, Range } from "@cursorless/common"; +import type { Direction } from "@cursorless/common"; +import type { TargetScope } from "./scope.types"; /** * Defines the canonical scope ordering. diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scope.types.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scope.types.ts index 73ce68be3..e4f2bba0a 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scope.types.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scope.types.ts @@ -1,4 +1,4 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { Range, TextEditor } from "@cursorless/common"; import type { Target } from "../../../typings/target.types"; /** diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scopeTypeUtil.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scopeTypeUtil.ts index 95f6ad3c6..bdf7f8da4 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scopeTypeUtil.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/scopeTypeUtil.ts @@ -1,4 +1,4 @@ -import { ScopeType } from "@cursorless/common"; +import type { ScopeType } from "@cursorless/common"; export function scopeTypeToString(scopeType: ScopeType) { return scopeType.type; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/shouldYieldScope.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/shouldYieldScope.ts index 81c6dcac1..303569225 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/shouldYieldScope.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/shouldYieldScope.ts @@ -1,9 +1,10 @@ -import { Position, Range } from "@cursorless/common"; -import { Direction } from "@cursorless/common"; +import type { Position } from "@cursorless/common"; +import { Range } from "@cursorless/common"; +import type { Direction } from "@cursorless/common"; import { strictlyContains } from "../../../util/rangeUtils"; import { compareTargetScopes } from "./compareTargetScopes"; -import { TargetScope } from "./scope.types"; -import { ScopeIteratorRequirements } from "./scopeHandler.types"; +import type { TargetScope } from "./scope.types"; +import type { ScopeIteratorRequirements } from "./scopeHandler.types"; /** * Returns `true` if the scope should be yielded. Checks that the scope meets diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeTypeStages/LegacyContainingSyntaxScopeStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeTypeStages/LegacyContainingSyntaxScopeStage.ts index c9d693efb..d3ba647c4 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeTypeStages/LegacyContainingSyntaxScopeStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeTypeStages/LegacyContainingSyntaxScopeStage.ts @@ -5,7 +5,7 @@ import type { } from "@cursorless/common"; import { NoContainingScopeError, Selection } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; +import type { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; import { getNodeMatcher } from "../../../languages/getNodeMatcher"; import type { NodeMatcher, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/targetSequenceUtils.ts b/packages/cursorless-engine/src/processTargets/modifiers/targetSequenceUtils.ts index 6da4a4152..f91dcf602 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/targetSequenceUtils.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/targetSequenceUtils.ts @@ -1,6 +1,6 @@ -import { ScopeType } from "@cursorless/common"; -import { Target } from "../../typings/target.types"; -import { ModifierStageFactory } from "../ModifierStageFactory"; +import type { ScopeType } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import { createContinuousRangeTarget } from "../createContinuousRangeTarget"; import { assertIndices } from "./listUtils"; diff --git a/packages/cursorless-engine/src/processTargets/targets/BaseTarget.ts b/packages/cursorless-engine/src/processTargets/targets/BaseTarget.ts index 783a35f1b..cd8c0dfea 100644 --- a/packages/cursorless-engine/src/processTargets/targets/BaseTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/BaseTarget.ts @@ -2,13 +2,11 @@ import type { EnforceUndefined, InsertionMode, TargetPlainObject, -} from "@cursorless/common"; -import { Range, Selection, TextEditor, - rangeToPlainObject, } from "@cursorless/common"; +import { rangeToPlainObject } from "@cursorless/common"; import { isEqual } from "lodash-es"; import type { EditWithRangeUpdater } from "../../typings/Types"; import type { Destination, Target } from "../../typings/target.types"; diff --git a/packages/cursorless-engine/src/processTargets/targets/BoundedParagraphTarget.ts b/packages/cursorless-engine/src/processTargets/targets/BoundedParagraphTarget.ts index 96e0813c9..70456e0d5 100644 --- a/packages/cursorless-engine/src/processTargets/targets/BoundedParagraphTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/BoundedParagraphTarget.ts @@ -1,8 +1,9 @@ -import { Range } from "@cursorless/common"; -import { BaseTarget, MinimumTargetParameters } from "./BaseTarget"; +import type { Range } from "@cursorless/common"; +import type { MinimumTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { LineTarget } from "./LineTarget"; import { expandToFullLine } from "../../util/rangeUtils"; -import { InteriorTarget, ParagraphTarget } from "."; +import type { InteriorTarget, ParagraphTarget } from "."; interface BoundedParagraphTargetParameters extends MinimumTargetParameters { readonly paragraphTarget: ParagraphTarget; diff --git a/packages/cursorless-engine/src/processTargets/targets/DestinationImpl.ts b/packages/cursorless-engine/src/processTargets/targets/DestinationImpl.ts index b1dc7884c..3414d0c44 100644 --- a/packages/cursorless-engine/src/processTargets/targets/DestinationImpl.ts +++ b/packages/cursorless-engine/src/processTargets/targets/DestinationImpl.ts @@ -1,11 +1,7 @@ -import { - InsertionMode, - Range, - Selection, - TextEditor, -} from "@cursorless/common"; -import { EditWithRangeUpdater } from "../../typings/Types"; -import { +import type { InsertionMode, Selection, TextEditor } from "@cursorless/common"; +import { Range } from "@cursorless/common"; +import type { EditWithRangeUpdater } from "../../typings/Types"; +import type { Destination, EditNewActionType, Target, diff --git a/packages/cursorless-engine/src/processTargets/targets/DocumentTarget.ts b/packages/cursorless-engine/src/processTargets/targets/DocumentTarget.ts index b5fef821e..7773de4af 100644 --- a/packages/cursorless-engine/src/processTargets/targets/DocumentTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/DocumentTarget.ts @@ -1,6 +1,7 @@ -import { Range } from "@cursorless/common"; +import type { Range } from "@cursorless/common"; import { shrinkRangeToFitContent } from "../../util/selectionUtils"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { PlainTarget } from "./PlainTarget"; export class DocumentTarget extends BaseTarget { diff --git a/packages/cursorless-engine/src/processTargets/targets/HeadTailTarget.ts b/packages/cursorless-engine/src/processTargets/targets/HeadTailTarget.ts index d3e6ce424..540cbb5a8 100644 --- a/packages/cursorless-engine/src/processTargets/targets/HeadTailTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/HeadTailTarget.ts @@ -1,6 +1,7 @@ import { Range } from "@cursorless/common"; -import { BaseTarget, MinimumTargetParameters } from "./BaseTarget"; -import { Target } from "../../typings/target.types"; +import type { MinimumTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; +import type { Target } from "../../typings/target.types"; import { getTokenLeadingDelimiterTarget, getTokenRemovalRange, diff --git a/packages/cursorless-engine/src/processTargets/targets/ImplicitTarget.ts b/packages/cursorless-engine/src/processTargets/targets/ImplicitTarget.ts index 70a4bad02..f88fabfc0 100644 --- a/packages/cursorless-engine/src/processTargets/targets/ImplicitTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/ImplicitTarget.ts @@ -1,5 +1,6 @@ -import { EnforceUndefined } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { EnforceUndefined } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; /** * A target that was not explicitly spoken by the user. For example: diff --git a/packages/cursorless-engine/src/processTargets/targets/InteriorTarget.ts b/packages/cursorless-engine/src/processTargets/targets/InteriorTarget.ts index 25062d3c3..d7a38da9e 100644 --- a/packages/cursorless-engine/src/processTargets/targets/InteriorTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/InteriorTarget.ts @@ -1,5 +1,6 @@ -import { Range } from "@cursorless/common"; -import { BaseTarget, MinimumTargetParameters } from "./BaseTarget"; +import type { Range } from "@cursorless/common"; +import type { MinimumTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { shrinkRangeToFitContent } from "../../util/selectionUtils"; import { createContinuousRangeFromRanges } from "./util/createContinuousRange"; diff --git a/packages/cursorless-engine/src/processTargets/targets/LineTarget.ts b/packages/cursorless-engine/src/processTargets/targets/LineTarget.ts index ab5c798a7..29ac83f9d 100644 --- a/packages/cursorless-engine/src/processTargets/targets/LineTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/LineTarget.ts @@ -1,5 +1,7 @@ -import { Position, Range, TextEditor } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { TextEditor } from "@cursorless/common"; +import { Position, Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { expandToFullLine } from "../../util/rangeUtils"; import { tryConstructPlainTarget } from "./PlainTarget"; import { createContinuousLineRange } from "./util/createContinuousRange"; diff --git a/packages/cursorless-engine/src/processTargets/targets/NotebookCellDestination.ts b/packages/cursorless-engine/src/processTargets/targets/NotebookCellDestination.ts index 38dec0925..ba667d757 100644 --- a/packages/cursorless-engine/src/processTargets/targets/NotebookCellDestination.ts +++ b/packages/cursorless-engine/src/processTargets/targets/NotebookCellDestination.ts @@ -1,12 +1,15 @@ -import { +import type { InsertionMode, Range, Selection, TextEditor, } from "@cursorless/common"; -import { EditWithRangeUpdater } from "../../typings/Types"; -import { Destination, EditNewActionType } from "../../typings/target.types"; -import { NotebookCellTarget } from "./NotebookCellTarget"; +import type { EditWithRangeUpdater } from "../../typings/Types"; +import type { + Destination, + EditNewActionType, +} from "../../typings/target.types"; +import type { NotebookCellTarget } from "./NotebookCellTarget"; export class NotebookCellDestination implements Destination { constructor( diff --git a/packages/cursorless-engine/src/processTargets/targets/NotebookCellTarget.ts b/packages/cursorless-engine/src/processTargets/targets/NotebookCellTarget.ts index ffdae5071..bed966212 100644 --- a/packages/cursorless-engine/src/processTargets/targets/NotebookCellTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/NotebookCellTarget.ts @@ -1,6 +1,7 @@ -import { InsertionMode } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; -import { Destination } from "../../typings/target.types"; +import type { InsertionMode } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; +import type { Destination } from "../../typings/target.types"; import { NotebookCellDestination } from "./NotebookCellDestination"; export class NotebookCellTarget extends BaseTarget { diff --git a/packages/cursorless-engine/src/processTargets/targets/ParagraphTarget.ts b/packages/cursorless-engine/src/processTargets/targets/ParagraphTarget.ts index 09e02adda..445cde743 100644 --- a/packages/cursorless-engine/src/processTargets/targets/ParagraphTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/ParagraphTarget.ts @@ -1,11 +1,7 @@ -import { - Position, - Range, - TextDocument, - TextEditor, - TextLine, -} from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { TextDocument, TextEditor, TextLine } from "@cursorless/common"; +import { Position, Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { LineTarget } from "./LineTarget"; import { expandToFullLine } from "../../util/rangeUtils"; import { constructLineTarget } from "./LineTarget"; diff --git a/packages/cursorless-engine/src/processTargets/targets/PlainTarget.ts b/packages/cursorless-engine/src/processTargets/targets/PlainTarget.ts index 65bd31fe5..48576bd43 100644 --- a/packages/cursorless-engine/src/processTargets/targets/PlainTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/PlainTarget.ts @@ -1,6 +1,7 @@ import { tryConstructTarget } from "../../util/tryConstructTarget"; -import { TextEditor, Range } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { TextEditor, Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; interface PlainTargetParameters extends CommonTargetParameters { readonly isToken?: boolean; diff --git a/packages/cursorless-engine/src/processTargets/targets/RawSelectionTarget.ts b/packages/cursorless-engine/src/processTargets/targets/RawSelectionTarget.ts index f924bccc5..16f4478f2 100644 --- a/packages/cursorless-engine/src/processTargets/targets/RawSelectionTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/RawSelectionTarget.ts @@ -1,5 +1,6 @@ -import { EnforceUndefined } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { EnforceUndefined } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; /** * A target that has no leading or trailing delimiters so it's removal range diff --git a/packages/cursorless-engine/src/processTargets/targets/ScopeTypeTarget.ts b/packages/cursorless-engine/src/processTargets/targets/ScopeTypeTarget.ts index 364127cca..ca757840f 100644 --- a/packages/cursorless-engine/src/processTargets/targets/ScopeTypeTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/ScopeTypeTarget.ts @@ -1,8 +1,9 @@ -import { Range, SimpleScopeTypeType } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { Range, SimpleScopeTypeType } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { InteriorTarget } from "./InteriorTarget"; import { PlainTarget } from "./PlainTarget"; -import { Target } from "../../typings/target.types"; +import type { Target } from "../../typings/target.types"; import { createContinuousRange, createContinuousRangeFromRanges, diff --git a/packages/cursorless-engine/src/processTargets/targets/SubTokenWordTarget.ts b/packages/cursorless-engine/src/processTargets/targets/SubTokenWordTarget.ts index 5931758f2..15123e330 100644 --- a/packages/cursorless-engine/src/processTargets/targets/SubTokenWordTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/SubTokenWordTarget.ts @@ -1,5 +1,6 @@ -import { Range } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { tryConstructPlainTarget } from "./PlainTarget"; import { createContinuousRange } from "./util/createContinuousRange"; import { getDelimitedSequenceRemovalRange } from "./util/insertionRemovalBehaviors/DelimitedSequenceInsertionRemovalBehavior"; diff --git a/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts b/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts index c0fd32209..cb412b84f 100644 --- a/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts @@ -1,8 +1,9 @@ -import { Range } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import { InteriorTarget } from "./InteriorTarget"; import { TokenTarget } from "./TokenTarget"; -import { Target } from "../../typings/target.types"; +import type { Target } from "../../typings/target.types"; import { getTokenLeadingDelimiterTarget, getTokenRemovalRange, diff --git a/packages/cursorless-engine/src/processTargets/targets/TokenTarget.ts b/packages/cursorless-engine/src/processTargets/targets/TokenTarget.ts index 0d4d64e72..16a6d7733 100644 --- a/packages/cursorless-engine/src/processTargets/targets/TokenTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/TokenTarget.ts @@ -1,6 +1,7 @@ -import { Range } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; -import { Target } from "../../typings/target.types"; +import type { Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; +import type { Target } from "../../typings/target.types"; import { getTokenLeadingDelimiterTarget, getTokenRemovalRange, diff --git a/packages/cursorless-engine/src/processTargets/targets/UntypedTarget.ts b/packages/cursorless-engine/src/processTargets/targets/UntypedTarget.ts index 06aab1599..2a5ef3a45 100644 --- a/packages/cursorless-engine/src/processTargets/targets/UntypedTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/UntypedTarget.ts @@ -1,5 +1,6 @@ -import { Range } from "@cursorless/common"; -import { BaseTarget, CommonTargetParameters } from "./BaseTarget"; +import type { Range } from "@cursorless/common"; +import type { CommonTargetParameters } from "./BaseTarget"; +import { BaseTarget } from "./BaseTarget"; import type { Target } from "../../typings/target.types"; import { getTokenLeadingDelimiterTarget, diff --git a/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/DelimitedSequenceInsertionRemovalBehavior.ts b/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/DelimitedSequenceInsertionRemovalBehavior.ts index 94626a50d..a518aa219 100644 --- a/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/DelimitedSequenceInsertionRemovalBehavior.ts +++ b/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/DelimitedSequenceInsertionRemovalBehavior.ts @@ -1,5 +1,5 @@ -import { Range } from "@cursorless/common"; -import { Target } from "../../../../typings/target.types"; +import type { Range } from "@cursorless/common"; +import type { Target } from "../../../../typings/target.types"; import { union } from "../../../../util/rangeUtils"; /** diff --git a/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/TokenInsertionRemovalBehavior.ts b/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/TokenInsertionRemovalBehavior.ts index ee7589805..29a6f1504 100644 --- a/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/TokenInsertionRemovalBehavior.ts +++ b/packages/cursorless-engine/src/processTargets/targets/util/insertionRemovalBehaviors/TokenInsertionRemovalBehavior.ts @@ -1,4 +1,5 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import type { Target } from "../../../../typings/target.types"; import { expandToFullLine, union } from "../../../../util/rangeUtils"; import { PlainTarget } from "../../PlainTarget"; diff --git a/packages/cursorless-engine/src/runCommand.ts b/packages/cursorless-engine/src/runCommand.ts index 50044cb7e..f30bf185b 100644 --- a/packages/cursorless-engine/src/runCommand.ts +++ b/packages/cursorless-engine/src/runCommand.ts @@ -1,22 +1,21 @@ -import { +import type { Command, CommandResponse, CommandServerApi, HatTokenMap, ReadOnlyHatMap, - clientSupportsFallback, - type TreeSitter, } from "@cursorless/common"; -import { CommandRunner } from "./CommandRunner"; +import { clientSupportsFallback, type TreeSitter } from "@cursorless/common"; +import type { CommandRunner } from "./CommandRunner"; import { Actions } from "./actions/Actions"; -import { CommandRunnerDecorator } from "./api/CursorlessEngineApi"; -import { Debug } from "./core/Debug"; +import type { CommandRunnerDecorator } from "./api/CursorlessEngineApi"; +import type { Debug } from "./core/Debug"; import { CommandRunnerImpl } from "./core/commandRunner/CommandRunnerImpl"; import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand"; -import { RangeUpdater } from "./core/updateSelections/RangeUpdater"; +import type { RangeUpdater } from "./core/updateSelections/RangeUpdater"; import type { Snippets } from "./core/Snippets"; import type { StoredTargetMap } from "./core/StoredTargets"; -import { LanguageDefinitions } from "./languages/LanguageDefinitions"; +import type { LanguageDefinitions } from "./languages/LanguageDefinitions"; import { TargetPipelineRunner } from "./processTargets"; import { MarkStageFactoryImpl } from "./processTargets/MarkStageFactoryImpl"; import { ModifierStageFactoryImpl } from "./processTargets/ModifierStageFactoryImpl"; diff --git a/packages/cursorless-engine/src/runIntegrationTests.ts b/packages/cursorless-engine/src/runIntegrationTests.ts index b41bf9a59..89294a92d 100644 --- a/packages/cursorless-engine/src/runIntegrationTests.ts +++ b/packages/cursorless-engine/src/runIntegrationTests.ts @@ -1,5 +1,5 @@ import { unsafeKeys, type TreeSitter } from "@cursorless/common"; -import { LanguageDefinitions } from "./languages/LanguageDefinitions"; +import type { LanguageDefinitions } from "./languages/LanguageDefinitions"; import { legacyLanguageIds } from "./languages/LegacyLanguageId"; import { languageMatchers } from "./languages/getNodeMatcher"; diff --git a/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts b/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts index 1f9da2f28..7578a5195 100644 --- a/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts +++ b/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts @@ -1,15 +1,14 @@ -import { +import type { Disposable, ScopeType, ScopeTypeInfo, ScopeTypeInfoEventCallback, SurroundingPairScopeType, - simpleScopeTypeTypes, - surroundingPairNames, } from "@cursorless/common"; +import { simpleScopeTypeTypes, surroundingPairNames } from "@cursorless/common"; import { pull } from "lodash-es"; -import { CustomSpokenFormGeneratorImpl } from "../generateSpokenForm/CustomSpokenFormGeneratorImpl"; +import type { CustomSpokenFormGeneratorImpl } from "../generateSpokenForm/CustomSpokenFormGeneratorImpl"; import { scopeTypeToString } from "./scopeTypeToString"; /** diff --git a/packages/cursorless-engine/src/scopeProviders/ScopeRangeProvider.ts b/packages/cursorless-engine/src/scopeProviders/ScopeRangeProvider.ts index 0e1ae1d0b..c69fe4c86 100644 --- a/packages/cursorless-engine/src/scopeProviders/ScopeRangeProvider.ts +++ b/packages/cursorless-engine/src/scopeProviders/ScopeRangeProvider.ts @@ -1,4 +1,4 @@ -import { +import type { IterationScopeRangeConfig, IterationScopeRanges, ScopeRangeConfig, @@ -6,8 +6,8 @@ import { TextEditor, } from "@cursorless/common"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; -import { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; import { getIterationRange } from "./getIterationRange"; import { getIterationScopeRanges } from "./getIterationScopeRanges"; import { getScopeRanges } from "./getScopeRanges"; diff --git a/packages/cursorless-engine/src/scopeProviders/ScopeRangeWatcher.ts b/packages/cursorless-engine/src/scopeProviders/ScopeRangeWatcher.ts index ff02abb84..5d1f56002 100644 --- a/packages/cursorless-engine/src/scopeProviders/ScopeRangeWatcher.ts +++ b/packages/cursorless-engine/src/scopeProviders/ScopeRangeWatcher.ts @@ -1,17 +1,17 @@ -import { +import type { Disposable, IterationScopeChangeEventCallback, IterationScopeRangeConfig, ScopeChangeEventCallback, ScopeRangeConfig, ScopeRanges, - showError, } from "@cursorless/common"; +import { showError } from "@cursorless/common"; import { pull } from "lodash-es"; -import { LanguageDefinitions } from "../languages/LanguageDefinitions"; +import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; import { ide } from "../singletons/ide.singleton"; -import { ScopeRangeProvider } from "./ScopeRangeProvider"; +import type { ScopeRangeProvider } from "./ScopeRangeProvider"; import { DecorationDebouncer } from "../util/DecorationDebouncer"; /** diff --git a/packages/cursorless-engine/src/scopeProviders/ScopeSupportChecker.ts b/packages/cursorless-engine/src/scopeProviders/ScopeSupportChecker.ts index 894d3b526..a3844346e 100644 --- a/packages/cursorless-engine/src/scopeProviders/ScopeSupportChecker.ts +++ b/packages/cursorless-engine/src/scopeProviders/ScopeSupportChecker.ts @@ -1,15 +1,13 @@ -import { - Position, - ScopeSupport, +import type { ScopeType, SimpleScopeTypeType, TextEditor, - isEmptyIterable, } from "@cursorless/common"; -import { LegacyLanguageId } from "../languages/LegacyLanguageId"; +import { Position, ScopeSupport, isEmptyIterable } from "@cursorless/common"; +import type { LegacyLanguageId } from "../languages/LegacyLanguageId"; import { languageMatchers } from "../languages/getNodeMatcher"; -import { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; -import { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; +import type { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; +import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; /** * Determines the level of support for a given scope type in a given editor. diff --git a/packages/cursorless-engine/src/scopeProviders/ScopeSupportWatcher.ts b/packages/cursorless-engine/src/scopeProviders/ScopeSupportWatcher.ts index 7520e24a8..69980ddae 100644 --- a/packages/cursorless-engine/src/scopeProviders/ScopeSupportWatcher.ts +++ b/packages/cursorless-engine/src/scopeProviders/ScopeSupportWatcher.ts @@ -1,18 +1,17 @@ -import { +import type { Disposable, - ScopeSupport, ScopeSupportEventCallback, ScopeSupportInfo, ScopeType, - disposableFrom, } from "@cursorless/common"; +import { ScopeSupport, disposableFrom } from "@cursorless/common"; import { pull } from "lodash-es"; -import { LanguageDefinitions } from "../languages/LanguageDefinitions"; +import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; import { ide } from "../singletons/ide.singleton"; import { DecorationDebouncer } from "../util/DecorationDebouncer"; -import { ScopeInfoProvider } from "./ScopeInfoProvider"; -import { ScopeSupportChecker } from "./ScopeSupportChecker"; +import type { ScopeInfoProvider } from "./ScopeInfoProvider"; +import type { ScopeSupportChecker } from "./ScopeSupportChecker"; /** * Watches for changes to the scope support of the active editor and notifies diff --git a/packages/cursorless-engine/src/scopeProviders/getIterationRange.ts b/packages/cursorless-engine/src/scopeProviders/getIterationRange.ts index 9f0350dbe..0fc797fc8 100644 --- a/packages/cursorless-engine/src/scopeProviders/getIterationRange.ts +++ b/packages/cursorless-engine/src/scopeProviders/getIterationRange.ts @@ -1,6 +1,6 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { Range, TextEditor } from "@cursorless/common"; import { last } from "lodash-es"; -import { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; +import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; /** * Get the range to iterate over for the given editor. diff --git a/packages/cursorless-engine/src/scopeProviders/getIterationScopeRanges.ts b/packages/cursorless-engine/src/scopeProviders/getIterationScopeRanges.ts index a28b6eb8b..678d6cc16 100644 --- a/packages/cursorless-engine/src/scopeProviders/getIterationScopeRanges.ts +++ b/packages/cursorless-engine/src/scopeProviders/getIterationScopeRanges.ts @@ -1,8 +1,12 @@ -import { IterationScopeRanges, Range, TextEditor } from "@cursorless/common"; +import type { + IterationScopeRanges, + Range, + TextEditor, +} from "@cursorless/common"; import { map } from "itertools"; -import { ModifierStage } from "../processTargets/PipelineStages.types"; -import { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; -import { Target } from "../typings/target.types"; +import type { ModifierStage } from "../processTargets/PipelineStages.types"; +import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; +import type { Target } from "../typings/target.types"; import { getTargetRanges } from "./getTargetRanges"; /** diff --git a/packages/cursorless-engine/src/scopeProviders/getScopeRanges.ts b/packages/cursorless-engine/src/scopeProviders/getScopeRanges.ts index 3e36c4f76..be37a3ff2 100644 --- a/packages/cursorless-engine/src/scopeProviders/getScopeRanges.ts +++ b/packages/cursorless-engine/src/scopeProviders/getScopeRanges.ts @@ -1,7 +1,7 @@ -import { Range, ScopeRanges, TextEditor } from "@cursorless/common"; +import type { Range, ScopeRanges, TextEditor } from "@cursorless/common"; import { map } from "itertools"; -import { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; +import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; import { getTargetRanges } from "./getTargetRanges"; /** diff --git a/packages/cursorless-engine/src/scopeProviders/getTargetRanges.ts b/packages/cursorless-engine/src/scopeProviders/getTargetRanges.ts index 58c8172d7..c18c9881c 100644 --- a/packages/cursorless-engine/src/scopeProviders/getTargetRanges.ts +++ b/packages/cursorless-engine/src/scopeProviders/getTargetRanges.ts @@ -1,9 +1,6 @@ -import { - TargetRanges, - toCharacterRange, - toLineRange, -} from "@cursorless/common"; -import { Target } from "../typings/target.types"; +import type { TargetRanges } from "@cursorless/common"; +import { toCharacterRange, toLineRange } from "@cursorless/common"; +import type { Target } from "../typings/target.types"; export function getTargetRanges(target: Target): TargetRanges { return { diff --git a/packages/cursorless-engine/src/scopeProviders/scopeTypeToString.ts b/packages/cursorless-engine/src/scopeProviders/scopeTypeToString.ts index 755ca90ec..6181b0ca3 100644 --- a/packages/cursorless-engine/src/scopeProviders/scopeTypeToString.ts +++ b/packages/cursorless-engine/src/scopeProviders/scopeTypeToString.ts @@ -1,8 +1,5 @@ -import { - ScopeType, - camelCaseToAllDown, - isSimpleScopeType, -} from "@cursorless/common"; +import type { ScopeType } from "@cursorless/common"; +import { camelCaseToAllDown, isSimpleScopeType } from "@cursorless/common"; export function scopeTypeToString(scopeType: ScopeType): string { if (isSimpleScopeType(scopeType)) { diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/checkMarks.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/checkMarks.ts index cf3beac10..3f55fd04d 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/checkMarks.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/checkMarks.ts @@ -1,4 +1,5 @@ -import { FakeIDE, TestCaseFixtureLegacy } from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; +import { FakeIDE } from "@cursorless/common"; import { uniq } from "lodash-es"; import { injectIde } from "../../singletons/ide.singleton"; import tokenGraphemeSplitter from "../../singletons/tokenGraphemeSplitter.singleton"; diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts index 5f657d43f..2994ecee1 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts @@ -1,15 +1,12 @@ -import { - CommandVersion, - LATEST_VERSION, - TestCaseFixtureLegacy, -} from "@cursorless/common"; +import type { CommandVersion, TestCaseFixtureLegacy } from "@cursorless/common"; +import { LATEST_VERSION } from "@cursorless/common"; import { getRecordedTestPaths } from "@cursorless/node-common"; import { checkMarks } from "./checkMarks"; import { transformFile } from "./transformFile"; import { canonicalize } from "./transformations/canonicalize"; import { identity } from "./transformations/identity"; import { upgrade } from "./transformations/upgrade"; -import { FixtureTransformation } from "./types"; +import type { FixtureTransformation } from "./types"; import { upgradeDecorations } from "./upgradeDecorations"; const AVAILABLE_TRANSFORMATIONS: Record = { diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts index edce4d039..c6e51dd70 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/moveFile.ts @@ -2,7 +2,7 @@ import { promises as fsp } from "node:fs"; import * as path from "node:path"; import * as yaml from "js-yaml"; import { mkdir, rename } from "node:fs/promises"; -import { TestCaseFixture } from "@cursorless/common"; +import type { TestCaseFixture } from "@cursorless/common"; /** * Can be used to organize files into directories based on eg language id diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformFile.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformFile.ts index 690966052..56eb23f04 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformFile.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformFile.ts @@ -1,7 +1,8 @@ import { promises as fsp } from "fs"; import * as yaml from "js-yaml"; -import { TestCaseFixture, serializeTestFixture } from "@cursorless/common"; -import { FixtureTransformation } from "./types"; +import type { TestCaseFixture } from "@cursorless/common"; +import { serializeTestFixture } from "@cursorless/common"; +import type { FixtureTransformation } from "./types"; export async function transformFile( transformation: FixtureTransformation, diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/canonicalize.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/canonicalize.ts index f21fdc4c3..2f0f4d809 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/canonicalize.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/canonicalize.ts @@ -1,4 +1,7 @@ -import { TestCaseFixture, TestCaseFixtureLegacy } from "@cursorless/common"; +import type { + TestCaseFixture, + TestCaseFixtureLegacy, +} from "@cursorless/common"; import { canonicalizeAndValidateCommand } from "../../../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; export function canonicalize(fixture: TestCaseFixtureLegacy): TestCaseFixture { diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/identity.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/identity.ts index 6f2bd4cc9..ac777c5b2 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/identity.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/identity.ts @@ -1,4 +1,4 @@ -import { TestCaseFixtureLegacy } from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; export function identity(fixture: TestCaseFixtureLegacy) { return fixture; diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgrade.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgrade.ts index 965f67337..1495cff64 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgrade.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgrade.ts @@ -1,8 +1,5 @@ -import { - CommandVersion, - LATEST_VERSION, - TestCaseFixtureLegacy, -} from "@cursorless/common"; +import type { CommandVersion, TestCaseFixtureLegacy } from "@cursorless/common"; +import { LATEST_VERSION } from "@cursorless/common"; import { upgradeCommand } from "../../../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; export function upgrade( diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgradeFromVersion0.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgradeFromVersion0.ts index 88450b67a..2ae9d9d1d 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgradeFromVersion0.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/transformations/upgradeFromVersion0.ts @@ -1,5 +1,5 @@ -import { PartialPrimitiveTargetDescriptor } from "@cursorless/common"; -import { TestCaseFixture } from "@cursorless/common"; +import type { PartialPrimitiveTargetDescriptor } from "@cursorless/common"; +import type { TestCaseFixture } from "@cursorless/common"; import { transformPartialPrimitiveTargets } from "../../../util/getPrimitiveTargets"; export function upgradeFromVersion0(fixture: TestCaseFixture) { diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/types.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/types.ts index c1d6bd3e2..a3f35478c 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/types.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/types.ts @@ -1,4 +1,4 @@ -import { TestCaseFixtureLegacy } from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; export type FixtureTransformation = ( originalFixture: TestCaseFixtureLegacy, diff --git a/packages/cursorless-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts b/packages/cursorless-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts index 6ae09c396..6a4cec696 100644 --- a/packages/cursorless-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts +++ b/packages/cursorless-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts @@ -1,11 +1,11 @@ -import { +import type { FlashStyle, GeneralizedRangePlainObject, PositionPlainObject, TestCaseFixtureLegacy, } from "@cursorless/common"; import { groupBy, partition } from "lodash-es"; -import { FixtureTransformation } from "./types"; +import type { FixtureTransformation } from "./types"; interface PlainTestDecoration { name: string; diff --git a/packages/cursorless-engine/src/singletons/ide.singleton.ts b/packages/cursorless-engine/src/singletons/ide.singleton.ts index 5531b7215..acfe529f6 100644 --- a/packages/cursorless-engine/src/singletons/ide.singleton.ts +++ b/packages/cursorless-engine/src/singletons/ide.singleton.ts @@ -1,4 +1,4 @@ -import { IDE } from "@cursorless/common"; +import type { IDE } from "@cursorless/common"; /** * This is the `ide` singleton diff --git a/packages/cursorless-engine/src/snippets/snippet.ts b/packages/cursorless-engine/src/snippets/snippet.ts index 02faada10..55a9e764a 100644 --- a/packages/cursorless-engine/src/snippets/snippet.ts +++ b/packages/cursorless-engine/src/snippets/snippet.ts @@ -1,13 +1,16 @@ -import { SimpleScopeTypeType, SnippetDefinition } from "@cursorless/common"; -import { Target } from "../typings/target.types"; +import type { + SimpleScopeTypeType, + SnippetDefinition, +} from "@cursorless/common"; +import type { Target } from "../typings/target.types"; +import type { TextmateSnippet } from "./vendor/vscodeSnippet/snippetParser"; import { Placeholder, Text, - TextmateSnippet, Variable, } from "./vendor/vscodeSnippet/snippetParser"; import { KnownSnippetVariableNames } from "./vendor/vscodeSnippet/snippetVariables"; -import { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; /** * Replaces the snippet variable with name `placeholderName` with diff --git a/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts b/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts index 2cd53b8a0..143265605 100644 --- a/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts +++ b/packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts @@ -1,24 +1,26 @@ -import { +import type { CustomRegexScopeType, - DisabledCustomSpokenFormsError, Disposable, - NeedsInitialTalonUpdateError, - Notifier, - SUPPORTED_ENTRY_TYPES, SpokenFormEntry, SpokenFormMapKeyTypes, SpokenFormType, TalonSpokenForms, +} from "@cursorless/common"; +import { + DisabledCustomSpokenFormsError, + NeedsInitialTalonUpdateError, + Notifier, + SUPPORTED_ENTRY_TYPES, showError, } from "@cursorless/common"; import { isEqual } from "lodash-es"; import { ide } from "../singletons/ide.singleton"; -import { SpokenFormMap, SpokenFormMapEntry } from "./SpokenFormMap"; +import type { SpokenFormMap, SpokenFormMapEntry } from "./SpokenFormMap"; import { defaultSpokenFormInfoMap, defaultSpokenFormMap, } from "./defaultSpokenFormMap"; -import { DefaultSpokenFormMapEntry } from "./defaultSpokenFormMap.types"; +import type { DefaultSpokenFormMapEntry } from "./defaultSpokenFormMap.types"; type Writable = { -readonly [K in keyof T]: T[K]; diff --git a/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts b/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts index a7a81a93b..2b4ed0276 100644 --- a/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts +++ b/packages/cursorless-engine/src/spokenForms/SpokenFormMap.ts @@ -1,4 +1,4 @@ -import { +import type { SpokenFormType, PartialSpokenFormTypes, SpokenFormMapKeyTypes, diff --git a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.ts b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.ts index 158e784d7..a31d7cc93 100644 --- a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.ts +++ b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.ts @@ -1,6 +1,7 @@ -import { SpokenFormMap, mapSpokenForms } from "./SpokenFormMap"; +import type { SpokenFormMap } from "./SpokenFormMap"; +import { mapSpokenForms } from "./SpokenFormMap"; import { defaultSpokenFormMapCore } from "./defaultSpokenFormMapCore"; -import { DefaultSpokenFormInfoMap } from "./defaultSpokenFormMap.types"; +import type { DefaultSpokenFormInfoMap } from "./defaultSpokenFormMap.types"; /** * This map contains information about the default spoken forms for all our diff --git a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts index 360c79fb7..fe0da2bac 100644 --- a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts +++ b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMap.types.ts @@ -1,5 +1,5 @@ -import { SpokenFormMappingType } from "./SpokenFormMap"; -import { SpokenFormMapKeyTypes } from "@cursorless/common"; +import type { SpokenFormMappingType } from "./SpokenFormMap"; +import type { SpokenFormMapKeyTypes } from "@cursorless/common"; export type DefaultSpokenFormMapDefinition = { readonly [K in keyof SpokenFormMapKeyTypes]: Readonly< diff --git a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMapCore.ts b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMapCore.ts index 950a5b010..7717823ec 100644 --- a/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMapCore.ts +++ b/packages/cursorless-engine/src/spokenForms/defaultSpokenFormMapCore.ts @@ -1,4 +1,4 @@ -import { DefaultSpokenFormMapDefinition } from "./defaultSpokenFormMap.types"; +import type { DefaultSpokenFormMapDefinition } from "./defaultSpokenFormMap.types"; import { graphemeDefaultSpokenForms } from "./graphemes"; import { isDisabledByDefault, isPrivate } from "./spokenFormMapUtil"; diff --git a/packages/cursorless-engine/src/spokenForms/spokenFormMapUtil.ts b/packages/cursorless-engine/src/spokenForms/spokenFormMapUtil.ts index 602f8df49..37f260f62 100644 --- a/packages/cursorless-engine/src/spokenForms/spokenFormMapUtil.ts +++ b/packages/cursorless-engine/src/spokenForms/spokenFormMapUtil.ts @@ -1,4 +1,4 @@ -import { DefaultSpokenFormMapEntry } from "./defaultSpokenFormMap.types"; +import type { DefaultSpokenFormMapEntry } from "./defaultSpokenFormMap.types"; /** * Used to construct entities that should not be speakable by default. diff --git a/packages/cursorless-engine/src/test/fixtures/communitySnippets.fixture.ts b/packages/cursorless-engine/src/test/fixtures/communitySnippets.fixture.ts index 0c4d3f55e..d9ccddd19 100644 --- a/packages/cursorless-engine/src/test/fixtures/communitySnippets.fixture.ts +++ b/packages/cursorless-engine/src/test/fixtures/communitySnippets.fixture.ts @@ -1,4 +1,4 @@ -import { ActionDescriptor } from "@cursorless/common"; +import type { ActionDescriptor } from "@cursorless/common"; import { spokenFormTest } from "./spokenFormTest"; const verticalRangeAction: ActionDescriptor = { diff --git a/packages/cursorless-engine/src/test/fixtures/multiAction.fixture.ts b/packages/cursorless-engine/src/test/fixtures/multiAction.fixture.ts index b2809b985..fb6471214 100644 --- a/packages/cursorless-engine/src/test/fixtures/multiAction.fixture.ts +++ b/packages/cursorless-engine/src/test/fixtures/multiAction.fixture.ts @@ -1,4 +1,4 @@ -import { ActionDescriptor } from "@cursorless/common"; +import type { ActionDescriptor } from "@cursorless/common"; import { multiActionSpokenFormTest } from "./spokenFormTest"; const getTextAction: ActionDescriptor = { diff --git a/packages/cursorless-engine/src/test/fixtures/spokenFormTest.ts b/packages/cursorless-engine/src/test/fixtures/spokenFormTest.ts index 0bdcf1fa1..fc12a4b85 100644 --- a/packages/cursorless-engine/src/test/fixtures/spokenFormTest.ts +++ b/packages/cursorless-engine/src/test/fixtures/spokenFormTest.ts @@ -1,4 +1,4 @@ -import { +import type { ActionDescriptor, CommandResponse, CommandV6, diff --git a/packages/cursorless-engine/src/test/fixtures/synonymousSpokenForms.fixture.ts b/packages/cursorless-engine/src/test/fixtures/synonymousSpokenForms.fixture.ts index 87f91d7ee..130efaed8 100644 --- a/packages/cursorless-engine/src/test/fixtures/synonymousSpokenForms.fixture.ts +++ b/packages/cursorless-engine/src/test/fixtures/synonymousSpokenForms.fixture.ts @@ -1,4 +1,4 @@ -import { ActionDescriptor } from "@cursorless/common"; +import type { ActionDescriptor } from "@cursorless/common"; import { spokenFormTest } from "./spokenFormTest"; const verticalRangeAction: ActionDescriptor = { diff --git a/packages/cursorless-engine/src/test/fixtures/talonApi.fixture.ts b/packages/cursorless-engine/src/test/fixtures/talonApi.fixture.ts index d2493b23a..fac4504e5 100644 --- a/packages/cursorless-engine/src/test/fixtures/talonApi.fixture.ts +++ b/packages/cursorless-engine/src/test/fixtures/talonApi.fixture.ts @@ -1,4 +1,4 @@ -import { +import type { ActionDescriptor, GetTextActionOptions, PartialPrimitiveTargetDescriptor, diff --git a/packages/cursorless-engine/src/test/spokenForms.talon.test.ts b/packages/cursorless-engine/src/test/spokenForms.talon.test.ts index 3d44e3239..950b582e5 100644 --- a/packages/cursorless-engine/src/test/spokenForms.talon.test.ts +++ b/packages/cursorless-engine/src/test/spokenForms.talon.test.ts @@ -1,9 +1,9 @@ -import { +import type { Command, CommandLatest, TestCaseFixtureLegacy, - asyncSafety, } from "@cursorless/common"; +import { asyncSafety } from "@cursorless/common"; import { getRecordedTestPaths } from "@cursorless/node-common"; import assert from "assert"; import * as yaml from "js-yaml"; @@ -13,7 +13,7 @@ import { getHatMapCommand } from "../generateSpokenForm/getHatMapCommand"; import { TalonRepl } from "../testUtil/TalonRepl"; import { communitySnippetsSpokenFormsFixture } from "./fixtures/communitySnippets.fixture"; import { multiActionFixture } from "./fixtures/multiAction.fixture"; -import { SpokenFormTestOpts } from "./fixtures/spokenFormTest"; +import type { SpokenFormTestOpts } from "./fixtures/spokenFormTest"; import { synonymousSpokenFormsFixture } from "./fixtures/synonymousSpokenForms.fixture"; import { talonApiFixture } from "./fixtures/talonApi.fixture"; diff --git a/packages/cursorless-engine/src/testUtil/extractTargetKeys.ts b/packages/cursorless-engine/src/testUtil/extractTargetKeys.ts index 0717578ae..a4fca71c4 100644 --- a/packages/cursorless-engine/src/testUtil/extractTargetKeys.ts +++ b/packages/cursorless-engine/src/testUtil/extractTargetKeys.ts @@ -1,10 +1,13 @@ -import { +import type { PartialMark, PartialPrimitiveTargetDescriptor, PartialTargetDescriptor, - getKey, } from "@cursorless/common"; -import { Mark, PrimitiveTargetDescriptor } from "../typings/TargetDescriptor"; +import { getKey } from "@cursorless/common"; +import type { + Mark, + PrimitiveTargetDescriptor, +} from "../typings/TargetDescriptor"; export function extractTargetKeys(target: PartialTargetDescriptor): string[] { switch (target.type) { diff --git a/packages/cursorless-engine/src/testUtil/plainObjectToTarget.ts b/packages/cursorless-engine/src/testUtil/plainObjectToTarget.ts index ace22ca75..7cc5ae316 100644 --- a/packages/cursorless-engine/src/testUtil/plainObjectToTarget.ts +++ b/packages/cursorless-engine/src/testUtil/plainObjectToTarget.ts @@ -1,10 +1,7 @@ -import { - plainObjectToRange, - TargetPlainObject, - TextEditor, -} from "@cursorless/common"; +import type { TargetPlainObject, TextEditor } from "@cursorless/common"; +import { plainObjectToRange } from "@cursorless/common"; import { LineTarget, UntypedTarget } from "../processTargets/targets"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; /** * Given a plain object describing a target, constructs a `Target` object. diff --git a/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts b/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts index 7e4950b22..d69e278b6 100644 --- a/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts +++ b/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts @@ -1,4 +1,4 @@ -import { TokenHatSplittingMode } from "@cursorless/common"; +import type { TokenHatSplittingMode } from "@cursorless/common"; import * as assert from "assert"; import { unitTestSetup } from "../test/unitTestSetup"; import { TokenGraphemeSplitter, UNKNOWN } from "./tokenGraphemeSplitter"; diff --git a/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts b/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts index ef816fdd8..6b8f9270e 100644 --- a/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts +++ b/packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts @@ -1,9 +1,5 @@ -import { - Disposable, - Notifier, - TokenHatSplittingMode, - matchAll, -} from "@cursorless/common"; +import type { Disposable, TokenHatSplittingMode } from "@cursorless/common"; +import { Notifier, matchAll } from "@cursorless/common"; import { deburr, escapeRegExp } from "lodash-es"; import { ide } from "../singletons/ide.singleton"; diff --git a/packages/cursorless-engine/src/tokenizer/tokenizer.ts b/packages/cursorless-engine/src/tokenizer/tokenizer.ts index a712c6d4a..05f921900 100644 --- a/packages/cursorless-engine/src/tokenizer/tokenizer.ts +++ b/packages/cursorless-engine/src/tokenizer/tokenizer.ts @@ -1,7 +1,7 @@ import { matchAll } from "@cursorless/common"; import { escapeRegExp } from "lodash-es"; import { ide } from "../singletons/ide.singleton"; -import { LanguageTokenizerComponents } from "./tokenizer.types"; +import type { LanguageTokenizerComponents } from "./tokenizer.types"; const REPEATABLE_SYMBOLS = [ "-", diff --git a/packages/cursorless-engine/src/typings/TargetDescriptor.ts b/packages/cursorless-engine/src/typings/TargetDescriptor.ts index f11a70b9b..fb2728cea 100644 --- a/packages/cursorless-engine/src/typings/TargetDescriptor.ts +++ b/packages/cursorless-engine/src/typings/TargetDescriptor.ts @@ -1,4 +1,4 @@ -import { +import type { ImplicitTargetDescriptor, Modifier, PartialMark, diff --git a/packages/cursorless-engine/src/util/DecorationDebouncer.ts b/packages/cursorless-engine/src/util/DecorationDebouncer.ts index ec532fab7..cb4ab8ef8 100644 --- a/packages/cursorless-engine/src/util/DecorationDebouncer.ts +++ b/packages/cursorless-engine/src/util/DecorationDebouncer.ts @@ -1,4 +1,5 @@ -import { Configuration, Debouncer } from "@cursorless/common"; +import type { Configuration } from "@cursorless/common"; +import { Debouncer } from "@cursorless/common"; export class DecorationDebouncer { private debouncer: Debouncer; diff --git a/packages/cursorless-engine/src/util/allocateHats/HatMetrics.ts b/packages/cursorless-engine/src/util/allocateHats/HatMetrics.ts index f007716d6..7c149b2d6 100644 --- a/packages/cursorless-engine/src/util/allocateHats/HatMetrics.ts +++ b/packages/cursorless-engine/src/util/allocateHats/HatMetrics.ts @@ -1,6 +1,7 @@ -import { CompositeKeyMap, HatStability, TokenHat } from "@cursorless/common"; +import type { CompositeKeyMap, TokenHat } from "@cursorless/common"; +import { HatStability } from "@cursorless/common"; import { memoize, min } from "lodash-es"; -import { HatCandidate } from "./allocateHats"; +import type { HatCandidate } from "./allocateHats"; /** * A function that takes a hat candidate and returns a number representing its diff --git a/packages/cursorless-engine/src/util/allocateHats/allocateHats.ts b/packages/cursorless-engine/src/util/allocateHats/allocateHats.ts index d529a99f8..27aa9a11f 100644 --- a/packages/cursorless-engine/src/util/allocateHats/allocateHats.ts +++ b/packages/cursorless-engine/src/util/allocateHats/allocateHats.ts @@ -1,15 +1,16 @@ -import { - CompositeKeyMap, - DefaultMap, +import type { HatStability, HatStyleMap, HatStyleName, - Range, TextEditor, Token, TokenHat, } from "@cursorless/common"; -import { Grapheme, TokenGraphemeSplitter } from "../../tokenGraphemeSplitter"; +import { CompositeKeyMap, DefaultMap, Range } from "@cursorless/common"; +import type { + Grapheme, + TokenGraphemeSplitter, +} from "../../tokenGraphemeSplitter"; import { chooseTokenHat } from "./chooseTokenHat"; import { getHatRankingContext } from "./getHatRankingContext"; import { getRankedTokens } from "./getRankedTokens"; diff --git a/packages/cursorless-engine/src/util/allocateHats/chooseTokenHat.ts b/packages/cursorless-engine/src/util/allocateHats/chooseTokenHat.ts index ca5e837f0..3843578ec 100644 --- a/packages/cursorless-engine/src/util/allocateHats/chooseTokenHat.ts +++ b/packages/cursorless-engine/src/util/allocateHats/chooseTokenHat.ts @@ -1,6 +1,6 @@ -import { HatStability, TokenHat } from "@cursorless/common"; -import { HatCandidate } from "./allocateHats"; -import { RankingContext } from "./getHatRankingContext"; +import type { HatStability, TokenHat } from "@cursorless/common"; +import type { HatCandidate } from "./allocateHats"; +import type { RankingContext } from "./getHatRankingContext"; import { hatOldTokenRank, isOldTokenHat, diff --git a/packages/cursorless-engine/src/util/allocateHats/getDisplayLineMap.ts b/packages/cursorless-engine/src/util/allocateHats/getDisplayLineMap.ts index 52653a1dd..e6692a7ab 100644 --- a/packages/cursorless-engine/src/util/allocateHats/getDisplayLineMap.ts +++ b/packages/cursorless-engine/src/util/allocateHats/getDisplayLineMap.ts @@ -1,4 +1,4 @@ -import { TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; import { concat, flatten, flow, range, uniq } from "lodash-es"; /** diff --git a/packages/cursorless-engine/src/util/allocateHats/getHatRankingContext.ts b/packages/cursorless-engine/src/util/allocateHats/getHatRankingContext.ts index 8a5aa42d4..2e9f9b530 100644 --- a/packages/cursorless-engine/src/util/allocateHats/getHatRankingContext.ts +++ b/packages/cursorless-engine/src/util/allocateHats/getHatRankingContext.ts @@ -1,11 +1,7 @@ -import { - CompositeKeyMap, - HatStyleName, - Token, - TokenHat, -} from "@cursorless/common"; -import { TokenGraphemeSplitter } from "../../tokenGraphemeSplitter"; -import { RankedToken } from "./getRankedTokens"; +import type { HatStyleName, Token, TokenHat } from "@cursorless/common"; +import { CompositeKeyMap } from "@cursorless/common"; +import type { TokenGraphemeSplitter } from "../../tokenGraphemeSplitter"; +import type { RankedToken } from "./getRankedTokens"; export interface RankingContext { /** diff --git a/packages/cursorless-engine/src/util/allocateHats/getRankedTokens.ts b/packages/cursorless-engine/src/util/allocateHats/getRankedTokens.ts index db1139210..33165235e 100644 --- a/packages/cursorless-engine/src/util/allocateHats/getRankedTokens.ts +++ b/packages/cursorless-engine/src/util/allocateHats/getRankedTokens.ts @@ -1,4 +1,4 @@ -import { +import type { CompositeKeyMap, TextEditor, Token, diff --git a/packages/cursorless-engine/src/util/allocateHats/getTokenComparator.ts b/packages/cursorless-engine/src/util/allocateHats/getTokenComparator.ts index c309f058f..0ffe1be63 100644 --- a/packages/cursorless-engine/src/util/allocateHats/getTokenComparator.ts +++ b/packages/cursorless-engine/src/util/allocateHats/getTokenComparator.ts @@ -1,4 +1,4 @@ -import { Token } from "@cursorless/common"; +import type { Token } from "@cursorless/common"; interface TokenWithDisplayLine extends Token { displayLine: number; diff --git a/packages/cursorless-engine/src/util/allocateHats/getTokensInRange.ts b/packages/cursorless-engine/src/util/allocateHats/getTokensInRange.ts index b3f276087..efa837210 100644 --- a/packages/cursorless-engine/src/util/allocateHats/getTokensInRange.ts +++ b/packages/cursorless-engine/src/util/allocateHats/getTokensInRange.ts @@ -1,6 +1,7 @@ -import { Range, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { tokenize } from "../../tokenizer"; -import { Token } from "@cursorless/common"; +import type { Token } from "@cursorless/common"; export function getTokensInRange(editor: TextEditor, range: Range): Token[] { const languageId = editor.document.languageId; diff --git a/packages/cursorless-engine/src/util/getMatchesInRange.ts b/packages/cursorless-engine/src/util/getMatchesInRange.ts index db133953e..e02aa3f3f 100644 --- a/packages/cursorless-engine/src/util/getMatchesInRange.ts +++ b/packages/cursorless-engine/src/util/getMatchesInRange.ts @@ -1,9 +1,5 @@ -import { - Range, - TextEditor, - matchAll, - type Direction, -} from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Range, matchAll, type Direction } from "@cursorless/common"; import { imap } from "itertools"; export function getMatchesInRange( diff --git a/packages/cursorless-engine/src/util/getPartialTargetDescriptors.ts b/packages/cursorless-engine/src/util/getPartialTargetDescriptors.ts index 0b5697305..ca9aa87ae 100644 --- a/packages/cursorless-engine/src/util/getPartialTargetDescriptors.ts +++ b/packages/cursorless-engine/src/util/getPartialTargetDescriptors.ts @@ -1,4 +1,4 @@ -import { +import type { ActionDescriptor, DestinationDescriptor, PartialTargetDescriptor, diff --git a/packages/cursorless-engine/src/util/getPrimitiveTargets.ts b/packages/cursorless-engine/src/util/getPrimitiveTargets.ts index 6a59b71cc..61ff3ff1f 100644 --- a/packages/cursorless-engine/src/util/getPrimitiveTargets.ts +++ b/packages/cursorless-engine/src/util/getPrimitiveTargets.ts @@ -1,4 +1,4 @@ -import { +import type { ImplicitTargetDescriptor, PartialPrimitiveTargetDescriptor, PartialRangeTargetDescriptor, diff --git a/packages/cursorless-engine/src/util/nodeFinders.ts b/packages/cursorless-engine/src/util/nodeFinders.ts index 60113c9a5..12553bf75 100644 --- a/packages/cursorless-engine/src/util/nodeFinders.ts +++ b/packages/cursorless-engine/src/util/nodeFinders.ts @@ -1,6 +1,7 @@ -import { Position, Selection } from "@cursorless/common"; +import type { Selection } from "@cursorless/common"; +import { Position } from "@cursorless/common"; import type { Point, SyntaxNode } from "web-tree-sitter"; -import { NodeFinder } from "../typings/Types"; +import type { NodeFinder } from "../typings/Types"; export const nodeFinder = ( isTargetNode: (node: SyntaxNode) => boolean, diff --git a/packages/cursorless-engine/src/util/nodeMatchers.ts b/packages/cursorless-engine/src/util/nodeMatchers.ts index dfb8218ed..115c943ab 100644 --- a/packages/cursorless-engine/src/util/nodeMatchers.ts +++ b/packages/cursorless-engine/src/util/nodeMatchers.ts @@ -1,6 +1,7 @@ -import { SimpleScopeTypeType, unsafeKeys } from "@cursorless/common"; +import type { SimpleScopeTypeType } from "@cursorless/common"; +import { unsafeKeys } from "@cursorless/common"; import type { SyntaxNode } from "web-tree-sitter"; -import { +import type { NodeFinder, NodeMatcher, NodeMatcherAlternative, diff --git a/packages/cursorless-engine/src/util/nodeSelectors.ts b/packages/cursorless-engine/src/util/nodeSelectors.ts index 49d34363d..d56a9c512 100644 --- a/packages/cursorless-engine/src/util/nodeSelectors.ts +++ b/packages/cursorless-engine/src/util/nodeSelectors.ts @@ -1,7 +1,8 @@ -import { Position, Range, Selection, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Position, Range, Selection } from "@cursorless/common"; import { identity, maxBy } from "lodash-es"; import type { Point, SyntaxNode } from "web-tree-sitter"; -import { +import type { NodeFinder, SelectionExtractor, SelectionWithContext, diff --git a/packages/cursorless-engine/src/util/performDocumentEdits.ts b/packages/cursorless-engine/src/util/performDocumentEdits.ts index d339dc41e..4f912d48b 100644 --- a/packages/cursorless-engine/src/util/performDocumentEdits.ts +++ b/packages/cursorless-engine/src/util/performDocumentEdits.ts @@ -1,5 +1,5 @@ -import { Edit, EditableTextEditor } from "@cursorless/common"; -import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import type { Edit, EditableTextEditor } from "@cursorless/common"; +import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; export async function performDocumentEdits( rangeUpdater: RangeUpdater, diff --git a/packages/cursorless-engine/src/util/rangeUtils.ts b/packages/cursorless-engine/src/util/rangeUtils.ts index 79dddd435..bf2b5d17c 100644 --- a/packages/cursorless-engine/src/util/rangeUtils.ts +++ b/packages/cursorless-engine/src/util/rangeUtils.ts @@ -1,4 +1,5 @@ -import { Position, Range, TextEditor } from "@cursorless/common"; +import type { TextEditor } from "@cursorless/common"; +import { Position, Range } from "@cursorless/common"; export function isAtEndOfLine(editor: TextEditor, position: Position) { const endLine = editor.document.lineAt(position); diff --git a/packages/cursorless-engine/src/util/selectionUtils.ts b/packages/cursorless-engine/src/util/selectionUtils.ts index e664f67c6..207bc9781 100644 --- a/packages/cursorless-engine/src/util/selectionUtils.ts +++ b/packages/cursorless-engine/src/util/selectionUtils.ts @@ -1,5 +1,6 @@ -import { Position, Range, Selection, TextEditor } from "@cursorless/common"; -import { SelectionWithEditor } from "../typings/Types"; +import type { Position, TextEditor } from "@cursorless/common"; +import { Range, Selection } from "@cursorless/common"; +import type { SelectionWithEditor } from "../typings/Types"; export function selectionWithEditorFromRange( selection: SelectionWithEditor, diff --git a/packages/cursorless-engine/src/util/targetUtils.ts b/packages/cursorless-engine/src/util/targetUtils.ts index d38c51fd9..2387c5db7 100644 --- a/packages/cursorless-engine/src/util/targetUtils.ts +++ b/packages/cursorless-engine/src/util/targetUtils.ts @@ -1,18 +1,20 @@ -import { +import type { FlashDescriptor, FlashStyle, GeneralizedRange, - groupBy, IDE, Range, - Selection, TextEditor, +} from "@cursorless/common"; +import { + groupBy, + Selection, toCharacterRange, toLineRange, } from "@cursorless/common"; import { zip } from "lodash-es"; -import { Destination, Target } from "../typings/target.types"; -import { SelectionWithEditor } from "../typings/Types"; +import type { Destination, Target } from "../typings/target.types"; +import type { SelectionWithEditor } from "../typings/Types"; export function ensureSingleEditor( targets: Target[] | Destination[], diff --git a/packages/cursorless-engine/src/util/tryConstructTarget.ts b/packages/cursorless-engine/src/util/tryConstructTarget.ts index a0670b7de..c68ff3a04 100644 --- a/packages/cursorless-engine/src/util/tryConstructTarget.ts +++ b/packages/cursorless-engine/src/util/tryConstructTarget.ts @@ -1,6 +1,6 @@ -import { Range, TextEditor } from "@cursorless/common"; -import { CommonTargetParameters } from "../processTargets/targets"; -import { Target } from "../typings/target.types"; +import type { Range, TextEditor } from "@cursorless/common"; +import type { CommonTargetParameters } from "../processTargets/targets"; +import type { Target } from "../typings/target.types"; type TargetConstructor = new ( parameters: CommonTargetParameters, diff --git a/packages/cursorless-engine/src/util/unifyRanges.ts b/packages/cursorless-engine/src/util/unifyRanges.ts index 851d575d6..23d1ec1b3 100644 --- a/packages/cursorless-engine/src/util/unifyRanges.ts +++ b/packages/cursorless-engine/src/util/unifyRanges.ts @@ -1,5 +1,5 @@ import { targetsToContinuousTarget } from "../processTargets/TargetPipelineRunner"; -import { Target } from "../typings/target.types"; +import type { Target } from "../typings/target.types"; import { groupTargetsForEachEditor } from "./targetUtils"; /** Unifies overlapping/intersecting targets */ diff --git a/packages/cursorless-everywhere-talon-core/src/ide/TalonJsIDE.ts b/packages/cursorless-everywhere-talon-core/src/ide/TalonJsIDE.ts index 80bd44dbb..eac3f302c 100644 --- a/packages/cursorless-everywhere-talon-core/src/ide/TalonJsIDE.ts +++ b/packages/cursorless-everywhere-talon-core/src/ide/TalonJsIDE.ts @@ -1,4 +1,4 @@ -import { +import type { Capabilities, Clipboard, Configuration, @@ -10,7 +10,6 @@ import { InputBoxOptions, Listener, Messages, - Notifier, OpenUntitledTextDocumentOptions, QuickPickOptions, RunMode, @@ -20,8 +19,8 @@ import { TextEditorSelectionChangeEvent, TextEditorVisibleRangesChangeEvent, WorkspaceFolder, - type KeyValueStore, } from "@cursorless/common"; +import { Notifier, type KeyValueStore } from "@cursorless/common"; import { pull } from "lodash-es"; import type { Talon } from "../types/talon.types"; import type { EditorState } from "../types/types"; diff --git a/packages/cursorless-everywhere-talon-core/src/ide/talonJsPerformEdits.ts b/packages/cursorless-everywhere-talon-core/src/ide/talonJsPerformEdits.ts index 8aa0628a4..de317c186 100644 --- a/packages/cursorless-everywhere-talon-core/src/ide/talonJsPerformEdits.ts +++ b/packages/cursorless-everywhere-talon-core/src/ide/talonJsPerformEdits.ts @@ -1,4 +1,5 @@ -import { Edit, type InMemoryTextDocument } from "@cursorless/common"; +import type { Edit } from "@cursorless/common"; +import { type InMemoryTextDocument } from "@cursorless/common"; import type { Talon } from "../types/talon.types"; import type { EditorEdit } from "../types/types"; import type { TalonJsIDE } from "./TalonJsIDE"; diff --git a/packages/cursorless-neovim-e2e/src/endToEndTestSetup.ts b/packages/cursorless-neovim-e2e/src/endToEndTestSetup.ts index 5dbd3b8d8..378d66131 100644 --- a/packages/cursorless-neovim-e2e/src/endToEndTestSetup.ts +++ b/packages/cursorless-neovim-e2e/src/endToEndTestSetup.ts @@ -1,6 +1,8 @@ -import { IDE, shouldUpdateFixtures, sleep, SpyIDE } from "@cursorless/common"; -import { getCursorlessApi, NeovimIDE } from "@cursorless/neovim-common"; -import { Context } from "mocha"; +import type { IDE } from "@cursorless/common"; +import { shouldUpdateFixtures, sleep, SpyIDE } from "@cursorless/common"; +import type { NeovimIDE } from "@cursorless/neovim-common"; +import { getCursorlessApi } from "@cursorless/neovim-common"; +import type { Context } from "mocha"; import * as sinon from "sinon"; /** diff --git a/packages/cursorless-neovim-e2e/src/shouldRunTest.ts b/packages/cursorless-neovim-e2e/src/shouldRunTest.ts index a862646de..5f24849b2 100644 --- a/packages/cursorless-neovim-e2e/src/shouldRunTest.ts +++ b/packages/cursorless-neovim-e2e/src/shouldRunTest.ts @@ -1,4 +1,4 @@ -import { TestCaseFixtureLegacy } from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; const failingFixtures = [ // actual finalState.selections.anchor is -1 compared to expected (other fixture.command.action.name == "insertCopyBefore" tests pass fine) diff --git a/packages/cursorless-neovim-e2e/src/suite/recorded.neovim.test.ts b/packages/cursorless-neovim-e2e/src/suite/recorded.neovim.test.ts index 67e91a6e4..fcbd5b62d 100644 --- a/packages/cursorless-neovim-e2e/src/suite/recorded.neovim.test.ts +++ b/packages/cursorless-neovim-e2e/src/suite/recorded.neovim.test.ts @@ -1,9 +1,12 @@ -import { TestCaseFixtureLegacy, asyncSafety } from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; +import { asyncSafety } from "@cursorless/common"; import { getRecordedTestPaths, runRecordedTest } from "@cursorless/node-common"; -import { +import type { NeovimIDE, NeovimTextEditorImpl, NewEditorOptions, +} from "@cursorless/neovim-common"; +import { getCursorlessApi, runCursorlessCommand, } from "@cursorless/neovim-common"; diff --git a/packages/cursorless-neovim/src/NeovimCommandServerApi.ts b/packages/cursorless-neovim/src/NeovimCommandServerApi.ts index dacccc01c..625c643fc 100644 --- a/packages/cursorless-neovim/src/NeovimCommandServerApi.ts +++ b/packages/cursorless-neovim/src/NeovimCommandServerApi.ts @@ -1,4 +1,4 @@ -import { +import type { CommandServerApi, FocusedElementType, InboundSignal, diff --git a/packages/cursorless-neovim/src/constructTestHelpers.ts b/packages/cursorless-neovim/src/constructTestHelpers.ts index e723dbd87..1d0c94119 100644 --- a/packages/cursorless-neovim/src/constructTestHelpers.ts +++ b/packages/cursorless-neovim/src/constructTestHelpers.ts @@ -1,4 +1,4 @@ -import { +import type { ExcludableSnapshotField, ExtraSnapshotField, FakeCommandServerApi, @@ -12,11 +12,9 @@ import { TestCaseSnapshot, TextEditor, } from "@cursorless/common"; -import { - StoredTargetMap, - plainObjectToTarget, -} from "@cursorless/cursorless-engine"; -import { NeovimIDE, NeovimTestHelpers } from "@cursorless/neovim-common"; +import type { StoredTargetMap } from "@cursorless/cursorless-engine"; +import { plainObjectToTarget } from "@cursorless/cursorless-engine"; +import type { NeovimIDE, NeovimTestHelpers } from "@cursorless/neovim-common"; import { takeSnapshot } from "@cursorless/test-case-recorder"; export function constructTestHelpers( diff --git a/packages/cursorless-neovim/src/registerCommands.ts b/packages/cursorless-neovim/src/registerCommands.ts index 3df1aa077..b71e6e967 100644 --- a/packages/cursorless-neovim/src/registerCommands.ts +++ b/packages/cursorless-neovim/src/registerCommands.ts @@ -1,15 +1,17 @@ -import { - CURSORLESS_COMMAND_ID, +import type { CommandResponse, CommandServerApi, CursorlessCommandId, +} from "@cursorless/common"; +import { + CURSORLESS_COMMAND_ID, clientSupportsFallback, ensureCommandShape, } from "@cursorless/common"; -import { CommandApi } from "@cursorless/cursorless-engine"; +import type { CommandApi } from "@cursorless/cursorless-engine"; +import type { NeovimIDE } from "@cursorless/neovim-common"; import { - NeovimIDE, modeSwitchNormalTerminal, modeSwitchTerminal, } from "@cursorless/neovim-common"; diff --git a/packages/cursorless-org/src/components/SpamProofEmailLink.tsx b/packages/cursorless-org/src/components/SpamProofEmailLink.tsx index 0cab33aea..357d39017 100644 --- a/packages/cursorless-org/src/components/SpamProofEmailLink.tsx +++ b/packages/cursorless-org/src/components/SpamProofEmailLink.tsx @@ -1,4 +1,4 @@ -import { EmailAddress } from "../parseEmailAddress"; +import type { EmailAddress } from "../parseEmailAddress"; interface Props extends React.PropsWithChildren { address: EmailAddress; diff --git a/packages/cursorless-org/src/pages/enablement-group.tsx b/packages/cursorless-org/src/pages/enablement-group.tsx index 76f6db51c..a27c5c13b 100644 --- a/packages/cursorless-org/src/pages/enablement-group.tsx +++ b/packages/cursorless-org/src/pages/enablement-group.tsx @@ -4,7 +4,8 @@ import { } from "../content/enablement-group.mdx"; import { Layout, bodyClasses } from "../components/Layout"; import { env } from "process"; -import { parseEmailAddress, EmailAddress } from "../parseEmailAddress"; +import type { EmailAddress } from "../parseEmailAddress"; +import { parseEmailAddress } from "../parseEmailAddress"; const RELATIVE_URL = "cursorless-enablement"; diff --git a/packages/cursorless-tutorial/src/Tutorial.ts b/packages/cursorless-tutorial/src/Tutorial.ts index 5809bcd28..577d92607 100644 --- a/packages/cursorless-tutorial/src/Tutorial.ts +++ b/packages/cursorless-tutorial/src/Tutorial.ts @@ -1,4 +1,4 @@ -import { +import type { Disposable, ScopeType, TutorialId, diff --git a/packages/cursorless-tutorial/src/TutorialImpl.ts b/packages/cursorless-tutorial/src/TutorialImpl.ts index 35b27b52e..58341088b 100644 --- a/packages/cursorless-tutorial/src/TutorialImpl.ts +++ b/packages/cursorless-tutorial/src/TutorialImpl.ts @@ -1,11 +1,9 @@ -import { +import type { CharacterRange, - Debouncer, Disposable, Hats, HatTokenMap, IDE, - Notifier, RawTutorialContent, ReadOnlyHatMap, ScopeType, @@ -14,7 +12,8 @@ import { TutorialId, TutorialState, } from "@cursorless/common"; -import { +import { Debouncer, Notifier } from "@cursorless/common"; +import type { CommandRunner, CommandRunnerDecorator, CustomSpokenFormGenerator, @@ -25,8 +24,8 @@ import { arePreconditionsMet } from "./arePreconditionsMet"; import { loadTutorial } from "./loadTutorial"; import { setupStep } from "./setupStep"; import { tutorialWrapCommandRunner } from "./tutorialWrapCommandRunner"; -import { TutorialContent } from "./types/tutorial.types"; -import { Tutorial } from "./Tutorial"; +import type { TutorialContent } from "./types/tutorial.types"; +import type { Tutorial } from "./Tutorial"; const HIGHLIGHT_COLOR = "highlight0"; diff --git a/packages/cursorless-tutorial/src/TutorialStepParser.ts b/packages/cursorless-tutorial/src/TutorialStepParser.ts index 39019f51b..05fbb1ee2 100644 --- a/packages/cursorless-tutorial/src/TutorialStepParser.ts +++ b/packages/cursorless-tutorial/src/TutorialStepParser.ts @@ -1,13 +1,11 @@ -import { +import type { Hats, TutorialContentProvider, TutorialId, TutorialStepFragment, } from "@cursorless/common"; -import { - CustomSpokenFormGenerator, - parseScopeType, -} from "@cursorless/cursorless-engine"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import { parseScopeType } from "@cursorless/cursorless-engine"; import { getScopeTypeSpokenFormStrict } from "./getScopeTypeSpokenFormStrict"; import { specialTerms } from "./specialTerms"; import { ActionComponentParser } from "./stepComponentParsers/ActionComponentParser"; @@ -15,8 +13,8 @@ import { CursorlessCommandComponentParser } from "./stepComponentParsers/Cursorl import { GraphemeComponentParser } from "./stepComponentParsers/GraphemeComponentParser"; import { parseSpecialComponent } from "./stepComponentParsers/parseSpecialComponent"; import { parseVisualizeComponent } from "./stepComponentParsers/parseVisualizeComponent"; -import { StepComponent } from "./types/StepComponent"; -import { TutorialStep } from "./types/tutorial.types"; +import type { StepComponent } from "./types/StepComponent"; +import type { TutorialStep } from "./types/tutorial.types"; /** * This is trying to catch occurrences of things like `{command:cloneStateInk.yml}` diff --git a/packages/cursorless-tutorial/src/arePreconditionsMet.ts b/packages/cursorless-tutorial/src/arePreconditionsMet.ts index 6b58a17d2..9c30d6bfe 100644 --- a/packages/cursorless-tutorial/src/arePreconditionsMet.ts +++ b/packages/cursorless-tutorial/src/arePreconditionsMet.ts @@ -1,11 +1,10 @@ +import type { HatTokenMap, TextEditor } from "@cursorless/common"; import { - HatTokenMap, - TextEditor, plainObjectToSelection, serializedMarksToTokenHats, } from "@cursorless/common"; import { isEqual } from "lodash-es"; -import { TutorialStep } from "./types/tutorial.types"; +import type { TutorialStep } from "./types/tutorial.types"; /** * Given an editor, a hat token map, and a tutorial step, check if the preconditions diff --git a/packages/cursorless-tutorial/src/getScopeTypeSpokenFormStrict.ts b/packages/cursorless-tutorial/src/getScopeTypeSpokenFormStrict.ts index 4c922f564..c5d213fd3 100644 --- a/packages/cursorless-tutorial/src/getScopeTypeSpokenFormStrict.ts +++ b/packages/cursorless-tutorial/src/getScopeTypeSpokenFormStrict.ts @@ -1,5 +1,5 @@ -import { ScopeType } from "@cursorless/common"; -import { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import type { ScopeType } from "@cursorless/common"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; import { getSpokenFormStrict } from "./getSpokenFormStrict"; export function getScopeTypeSpokenFormStrict( diff --git a/packages/cursorless-tutorial/src/getSpokenFormStrict.ts b/packages/cursorless-tutorial/src/getSpokenFormStrict.ts index b2361fb5c..a6f95fa6d 100644 --- a/packages/cursorless-tutorial/src/getSpokenFormStrict.ts +++ b/packages/cursorless-tutorial/src/getSpokenFormStrict.ts @@ -1,4 +1,4 @@ -import { SpokenForm } from "@cursorless/common"; +import type { SpokenForm } from "@cursorless/common"; import { TutorialError } from "./TutorialError"; export function getSpokenFormStrict(spokenForm: SpokenForm) { diff --git a/packages/cursorless-tutorial/src/loadTutorial.ts b/packages/cursorless-tutorial/src/loadTutorial.ts index 601d7d541..f0d9bf72a 100644 --- a/packages/cursorless-tutorial/src/loadTutorial.ts +++ b/packages/cursorless-tutorial/src/loadTutorial.ts @@ -1,15 +1,15 @@ -import { +import type { Hats, RawTutorialContent, TutorialContentProvider, TutorialId, TutorialState, - type KeyValueStore, } from "@cursorless/common"; -import { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import { type KeyValueStore } from "@cursorless/common"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; import { TutorialError } from "./TutorialError"; import { TutorialStepParser } from "./TutorialStepParser"; -import { TutorialContent } from "./types/tutorial.types"; +import type { TutorialContent } from "./types/tutorial.types"; export async function loadTutorial( contentProvider: TutorialContentProvider, diff --git a/packages/cursorless-tutorial/src/setupStep.ts b/packages/cursorless-tutorial/src/setupStep.ts index 8f2807660..573765094 100644 --- a/packages/cursorless-tutorial/src/setupStep.ts +++ b/packages/cursorless-tutorial/src/setupStep.ts @@ -1,16 +1,18 @@ -import { +import type { CharacterRange, HatTokenMap, IDE, TestCaseSnapshot, TextEditor, TutorialState, +} from "@cursorless/common"; +import { plainObjectToRange, plainObjectToSelection, serializedMarksToTokenHats, toCharacterRange, } from "@cursorless/common"; -import { TutorialContent } from "./types/tutorial.types"; +import type { TutorialContent } from "./types/tutorial.types"; interface HighlightedEditor { editor: TextEditor | undefined; diff --git a/packages/cursorless-tutorial/src/stepComponentParsers/ActionComponentParser.ts b/packages/cursorless-tutorial/src/stepComponentParsers/ActionComponentParser.ts index aba8cd975..7f17ff9aa 100644 --- a/packages/cursorless-tutorial/src/stepComponentParsers/ActionComponentParser.ts +++ b/packages/cursorless-tutorial/src/stepComponentParsers/ActionComponentParser.ts @@ -1,10 +1,12 @@ -import { ActionType, actionNames } from "@cursorless/common"; -import { - CustomSpokenFormGenerator, - defaultSpokenFormMap, -} from "@cursorless/cursorless-engine"; +import type { ActionType } from "@cursorless/common"; +import { actionNames } from "@cursorless/common"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import { defaultSpokenFormMap } from "@cursorless/cursorless-engine"; import { getSpokenFormStrict } from "../getSpokenFormStrict"; -import { StepComponent, StepComponentParser } from "../types/StepComponent"; +import type { + StepComponent, + StepComponentParser, +} from "../types/StepComponent"; /** * Parses components of the form `{action:chuck}`. diff --git a/packages/cursorless-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts b/packages/cursorless-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts index e7fa4cb5a..d4fc10599 100644 --- a/packages/cursorless-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts +++ b/packages/cursorless-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts @@ -1,22 +1,24 @@ -import { +import type { CommandComplete, CommandLatest, - getKey, Hats, HatStyleMap, - splitKey, TestCaseSnapshot, TutorialContentProvider, TutorialId, } from "@cursorless/common"; +import { getKey, splitKey } from "@cursorless/common"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; import { canonicalizeAndValidateCommand, - CustomSpokenFormGenerator, getPartialTargetDescriptors, transformPartialPrimitiveTargets, } from "@cursorless/cursorless-engine"; import { TutorialError } from "../TutorialError"; -import { StepComponent, StepComponentParser } from "../types/StepComponent"; +import type { + StepComponent, + StepComponentParser, +} from "../types/StepComponent"; import { cloneDeep, mapKeys } from "lodash-es"; import { produce } from "immer"; diff --git a/packages/cursorless-tutorial/src/stepComponentParsers/GraphemeComponentParser.ts b/packages/cursorless-tutorial/src/stepComponentParsers/GraphemeComponentParser.ts index 644d425d9..4ad06029d 100644 --- a/packages/cursorless-tutorial/src/stepComponentParsers/GraphemeComponentParser.ts +++ b/packages/cursorless-tutorial/src/stepComponentParsers/GraphemeComponentParser.ts @@ -1,6 +1,9 @@ -import { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; import { getSpokenFormStrict } from "../getSpokenFormStrict"; -import { StepComponent, StepComponentParser } from "../types/StepComponent"; +import type { + StepComponent, + StepComponentParser, +} from "../types/StepComponent"; /** * Parses components of the form `{grapheme:c}`. Used to refer to the user's diff --git a/packages/cursorless-tutorial/src/stepComponentParsers/parseSpecialComponent.ts b/packages/cursorless-tutorial/src/stepComponentParsers/parseSpecialComponent.ts index 728f744c9..3d9c1a9af 100644 --- a/packages/cursorless-tutorial/src/stepComponentParsers/parseSpecialComponent.ts +++ b/packages/cursorless-tutorial/src/stepComponentParsers/parseSpecialComponent.ts @@ -1,5 +1,5 @@ -import { TutorialStepTrigger } from "../types/TutorialStepTrigger"; -import { StepComponent } from "../types/StepComponent"; +import type { TutorialStepTrigger } from "../types/TutorialStepTrigger"; +import type { StepComponent } from "../types/StepComponent"; const SPECIAL_COMMANDS = { help: "cursorless help", diff --git a/packages/cursorless-tutorial/src/stepComponentParsers/parseVisualizeComponent.ts b/packages/cursorless-tutorial/src/stepComponentParsers/parseVisualizeComponent.ts index 0e0a1454b..a03cdfe06 100644 --- a/packages/cursorless-tutorial/src/stepComponentParsers/parseVisualizeComponent.ts +++ b/packages/cursorless-tutorial/src/stepComponentParsers/parseVisualizeComponent.ts @@ -1,10 +1,8 @@ -import { - CustomSpokenFormGenerator, - parseScopeType, -} from "@cursorless/cursorless-engine"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import { parseScopeType } from "@cursorless/cursorless-engine"; import { getScopeTypeSpokenFormStrict } from "../getScopeTypeSpokenFormStrict"; import { specialTerms } from "../specialTerms"; -import { StepComponent } from "../types/StepComponent"; +import type { StepComponent } from "../types/StepComponent"; /** * Parses components of the form `{visualize:funk}`. Displays the command for diff --git a/packages/cursorless-tutorial/src/tutorialWrapCommandRunner.ts b/packages/cursorless-tutorial/src/tutorialWrapCommandRunner.ts index f1bc5abb8..4d6ba32e1 100644 --- a/packages/cursorless-tutorial/src/tutorialWrapCommandRunner.ts +++ b/packages/cursorless-tutorial/src/tutorialWrapCommandRunner.ts @@ -1,8 +1,8 @@ -import { CommandComplete } from "@cursorless/common"; -import { CommandRunner } from "@cursorless/cursorless-engine"; +import type { CommandComplete } from "@cursorless/common"; +import type { CommandRunner } from "@cursorless/cursorless-engine"; import { isEqual } from "lodash-es"; -import { TutorialContent } from "./types/tutorial.types"; -import { Tutorial } from "./Tutorial"; +import type { TutorialContent } from "./types/tutorial.types"; +import type { Tutorial } from "./Tutorial"; /** * If the tutorial is currently active and we are in a step that is waiting diff --git a/packages/cursorless-tutorial/src/types/StepComponent.ts b/packages/cursorless-tutorial/src/types/StepComponent.ts index 3a75aaab0..3ec422217 100644 --- a/packages/cursorless-tutorial/src/types/StepComponent.ts +++ b/packages/cursorless-tutorial/src/types/StepComponent.ts @@ -1,5 +1,5 @@ -import { TutorialStepFragment } from "@cursorless/common"; -import { TutorialStep } from "./tutorial.types"; +import type { TutorialStepFragment } from "@cursorless/common"; +import type { TutorialStep } from "./tutorial.types"; /** * Represents a `{foo:bar}` component in a tutorial step, eg `{action:chuck}`. diff --git a/packages/cursorless-tutorial/src/types/TutorialStepTrigger.ts b/packages/cursorless-tutorial/src/types/TutorialStepTrigger.ts index 575e1cb84..72ae804b9 100644 --- a/packages/cursorless-tutorial/src/types/TutorialStepTrigger.ts +++ b/packages/cursorless-tutorial/src/types/TutorialStepTrigger.ts @@ -1,4 +1,4 @@ -import { CommandComplete, ScopeType } from "@cursorless/common"; +import type { CommandComplete, ScopeType } from "@cursorless/common"; /** * Advance to the next step when the user completes a command diff --git a/packages/cursorless-tutorial/src/types/tutorial.types.ts b/packages/cursorless-tutorial/src/types/tutorial.types.ts index cf729310e..16143db6b 100644 --- a/packages/cursorless-tutorial/src/types/tutorial.types.ts +++ b/packages/cursorless-tutorial/src/types/tutorial.types.ts @@ -1,5 +1,8 @@ -import { TestCaseSnapshot, TutorialStepFragment } from "@cursorless/common"; -import { TutorialStepTrigger } from "./TutorialStepTrigger"; +import type { + TestCaseSnapshot, + TutorialStepFragment, +} from "@cursorless/common"; +import type { TutorialStepTrigger } from "./TutorialStepTrigger"; /** * Represents the content of a tutorial. Used internally by the tutorial diff --git a/packages/cursorless-vscode-e2e/src/endToEndTestSetup.ts b/packages/cursorless-vscode-e2e/src/endToEndTestSetup.ts index 128bab80e..3c214e3da 100644 --- a/packages/cursorless-vscode-e2e/src/endToEndTestSetup.ts +++ b/packages/cursorless-vscode-e2e/src/endToEndTestSetup.ts @@ -1,6 +1,7 @@ -import { IDE, shouldUpdateFixtures, sleep, SpyIDE } from "@cursorless/common"; +import type { IDE } from "@cursorless/common"; +import { shouldUpdateFixtures, sleep, SpyIDE } from "@cursorless/common"; import { getCursorlessApi } from "@cursorless/vscode-common"; -import { Context } from "mocha"; +import type { Context } from "mocha"; import * as sinon from "sinon"; /** diff --git a/packages/cursorless-vscode-e2e/src/mockPrePhraseGetVersion.ts b/packages/cursorless-vscode-e2e/src/mockPrePhraseGetVersion.ts index 9441d8b27..0b91c3f04 100644 --- a/packages/cursorless-vscode-e2e/src/mockPrePhraseGetVersion.ts +++ b/packages/cursorless-vscode-e2e/src/mockPrePhraseGetVersion.ts @@ -1,4 +1,4 @@ -import { CommandServerApi } from "@cursorless/common"; +import type { CommandServerApi } from "@cursorless/common"; import * as sinon from "sinon"; export function mockPrePhraseGetVersion( diff --git a/packages/cursorless-vscode-e2e/src/notebook.ts b/packages/cursorless-vscode-e2e/src/notebook.ts index 695ad6ed8..6a52b567a 100644 --- a/packages/cursorless-vscode-e2e/src/notebook.ts +++ b/packages/cursorless-vscode-e2e/src/notebook.ts @@ -1,4 +1,4 @@ -import * as vscode from "vscode"; +import type * as vscode from "vscode"; export function getPlainNotebookContents(notebook: vscode.NotebookDocument) { return notebook.getCells().map((cell) => cell.document.getText()); diff --git a/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts index 3eba3f431..665417e67 100644 --- a/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/commandHistory.vscode.test.ts @@ -1,9 +1,9 @@ -import { +import type { CommandComplete, CommandHistoryEntry, - LATEST_VERSION, ReplaceActionDescriptor, } from "@cursorless/common"; +import { LATEST_VERSION } from "@cursorless/common"; import { getCursorlessApi, openNewEditor, diff --git a/packages/cursorless-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts index b3e26910d..604b02d15 100644 --- a/packages/cursorless-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts @@ -1,10 +1,5 @@ -import { - HatStability, - Modifier, - Range, - SpyIDE, - asyncSafety, -} from "@cursorless/common"; +import type { Modifier, SpyIDE } from "@cursorless/common"; +import { HatStability, Range, asyncSafety } from "@cursorless/common"; import { getCursorlessApi, openNewEditor, diff --git a/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts index f2524a9eb..6f94847da 100644 --- a/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts @@ -1,7 +1,7 @@ +import type { TextEditor } from "@cursorless/common"; import { DEFAULT_TEXT_EDITOR_OPTIONS_FOR_TEST, HatStability, - TextEditor, asyncSafety, } from "@cursorless/common"; import { getRecordedTestPaths, runRecordedTest } from "@cursorless/node-common"; diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts index 7f45a2730..da342d6b3 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts @@ -1,4 +1,4 @@ -import { ScopeType, ScopeTypeInfo } from "@cursorless/common"; +import type { ScopeType, ScopeTypeInfo } from "@cursorless/common"; import * as sinon from "sinon"; import { assert } from "chai"; import { sleepWithBackoff } from "../../endToEndTestSetup"; diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts index d26dc3ef7..1bd4beb10 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts @@ -1,7 +1,9 @@ -import { ScopeSupport, ScopeSupportInfo } from "@cursorless/common"; +import type { ScopeSupportInfo } from "@cursorless/common"; +import { ScopeSupport } from "@cursorless/common"; import { getCursorlessApi, openNewEditor } from "@cursorless/vscode-common"; import * as sinon from "sinon"; -import { Position, Range, TextDocument, commands } from "vscode"; +import type { TextDocument } from "vscode"; +import { Position, Range, commands } from "vscode"; import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo"; /** diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts index aa6bc7043..4cffbe8a3 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts @@ -1,9 +1,5 @@ -import { - ScopeSupport, - ScopeSupportInfo, - ScopeType, - sleep, -} from "@cursorless/common"; +import type { ScopeSupportInfo, ScopeType } from "@cursorless/common"; +import { ScopeSupport, sleep } from "@cursorless/common"; import { getCursorlessApi, openNewEditor } from "@cursorless/vscode-common"; import { stat, unlink, writeFile } from "fs/promises"; import * as sinon from "sinon"; diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts index 259de6fa9..a1bbdfa4e 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts @@ -1,5 +1,6 @@ import { getCursorlessApi } from "@cursorless/vscode-common"; -import { ScopeTypeInfo, sleep } from "@cursorless/common"; +import type { ScopeTypeInfo } from "@cursorless/common"; +import { sleep } from "@cursorless/common"; import * as sinon from "sinon"; import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo"; import { stat, unlink, writeFile } from "fs/promises"; diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts index 463a24088..344aab461 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts @@ -1,4 +1,5 @@ -import { ScopeSupport, ScopeSupportInfo } from "@cursorless/common"; +import type { ScopeSupportInfo } from "@cursorless/common"; +import { ScopeSupport } from "@cursorless/common"; import { getCursorlessApi, openNewEditor } from "@cursorless/vscode-common"; import * as sinon from "sinon"; import { Position, commands } from "vscode"; diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts index 662cd1bb8..ba584724a 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts @@ -1,10 +1,10 @@ import { assert } from "chai"; -import * as sinon from "sinon"; +import type * as sinon from "sinon"; import { createDecorationTypeCallToPlainObject, setDecorationsCallToPlainObject, } from "./spyCallsToPlainObject"; -import { Fakes, ExpectedArgs } from "./scopeVisualizerTest.types"; +import type { Fakes, ExpectedArgs } from "./scopeVisualizerTest.types"; export function checkAndResetFakes(fakes: Fakes, expected: ExpectedArgs) { const actual = getSpyCallsAndResetFakes(fakes); diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/colorConfig.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/colorConfig.ts index 93467cafe..cb504f729 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/colorConfig.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/colorConfig.ts @@ -1,4 +1,4 @@ -import { ScopeVisualizerColorConfig } from "@cursorless/vscode-common"; +import type { ScopeVisualizerColorConfig } from "@cursorless/vscode-common"; /** * Fake color config to use for testing. We use an alpha of 50% and try to use diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts index d444a8377..eb7386bf2 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts @@ -1,8 +1,9 @@ -import { VscodeApi, getCursorlessApi } from "@cursorless/vscode-common"; +import type { VscodeApi } from "@cursorless/vscode-common"; +import { getCursorlessApi } from "@cursorless/vscode-common"; import * as sinon from "sinon"; -import { DecorationRenderOptions, WorkspaceConfiguration } from "vscode"; +import type { DecorationRenderOptions, WorkspaceConfiguration } from "vscode"; import { COLOR_CONFIG } from "./colorConfig"; -import { +import type { Fakes, MockDecorationType, SetDecorationsParameters, diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts index 5e7a7993a..da6f577a8 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts @@ -2,7 +2,7 @@ import { openNewEditor } from "@cursorless/vscode-common"; import * as vscode from "vscode"; import { checkAndResetFakes } from "./checkAndResetFakes"; import { injectFakes } from "./injectFakes"; -import { ExpectedArgs } from "./scopeVisualizerTest.types"; +import type { ExpectedArgs } from "./scopeVisualizerTest.types"; /** * Tests that the scope visualizer works with multiline content, by diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts index 54b701883..1c0350ff3 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts @@ -2,7 +2,7 @@ import { openNewEditor } from "@cursorless/vscode-common"; import * as vscode from "vscode"; import { checkAndResetFakes } from "./checkAndResetFakes"; import { injectFakes } from "./injectFakes"; -import { ExpectedArgs } from "./scopeVisualizerTest.types"; +import type { ExpectedArgs } from "./scopeVisualizerTest.types"; /** * Tests that the scope visualizer works with removal ranges, by ensuring that diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts index 29570fa63..e5ebb54a7 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts @@ -2,7 +2,7 @@ import { openNewEditor } from "@cursorless/vscode-common"; import * as vscode from "vscode"; import { injectFakes } from "./injectFakes"; import { checkAndResetFakes } from "./checkAndResetFakes"; -import { ExpectedArgs } from "./scopeVisualizerTest.types"; +import type { ExpectedArgs } from "./scopeVisualizerTest.types"; /** * Tests that the scope visualizer works with nested multiline content, by diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts index d9f7e19fa..68532ae71 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts @@ -3,7 +3,7 @@ import * as vscode from "vscode"; import { sleepWithBackoff } from "../../endToEndTestSetup"; import { injectFakes } from "./injectFakes"; import { checkAndResetFakes } from "./checkAndResetFakes"; -import { ExpectedArgs } from "./scopeVisualizerTest.types"; +import type { ExpectedArgs } from "./scopeVisualizerTest.types"; /** * Tests that the scope visualizer updates correctly when the document is diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts index 71a935954..a77d9b426 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts @@ -1,7 +1,7 @@ -import { RangePlainObject } from "@cursorless/common"; -import { VscodeApi } from "@cursorless/vscode-common"; -import * as sinon from "sinon"; -import * as vscode from "vscode"; +import type { RangePlainObject } from "@cursorless/common"; +import type { VscodeApi } from "@cursorless/vscode-common"; +import type * as sinon from "sinon"; +import type * as vscode from "vscode"; export interface MockDecorationType { dispose(): void; diff --git a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts index e4b865c12..c77dc8a1b 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts @@ -1,12 +1,12 @@ import { rangeToPlainObject } from "@cursorless/common"; -import { DecorationRenderOptions } from "vscode"; -import { +import type { DecorationRenderOptions } from "vscode"; +import type { SetDecorationsParameters, DecorationRangesPlainObject, DecorationRenderOptionsPlainObject, MockDecorationType, } from "./scopeVisualizerTest.types"; -import { SinonSpyCall } from "sinon"; +import type { SinonSpyCall } from "sinon"; export function setDecorationsCallToPlainObject({ args: [_editor, decorationType, ranges], diff --git a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts index aafd173f1..e4453990b 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts @@ -1,12 +1,14 @@ +import type { + ScopeSupportFacet, + ScopeType, + TextualScopeSupportFacet, +} from "@cursorless/common"; import { asyncSafety, languageScopeSupport, - ScopeSupportFacet, scopeSupportFacetInfos, ScopeSupportFacetLevel, - ScopeType, shouldUpdateFixtures, - TextualScopeSupportFacet, textualScopeSupportFacetInfos, } from "@cursorless/common"; import { getScopeTestPathsRecursively } from "@cursorless/node-common"; diff --git a/packages/cursorless-vscode-e2e/src/suite/serializeHeader.ts b/packages/cursorless-vscode-e2e/src/suite/serializeHeader.ts index ec54ee087..64065c341 100644 --- a/packages/cursorless-vscode-e2e/src/suite/serializeHeader.ts +++ b/packages/cursorless-vscode-e2e/src/suite/serializeHeader.ts @@ -1,4 +1,4 @@ -import { Range } from "@cursorless/common"; +import type { Range } from "@cursorless/common"; interface SerializeHeaderArg { prefix?: string; diff --git a/packages/cursorless-vscode-e2e/src/suite/serializeScopeFixture.ts b/packages/cursorless-vscode-e2e/src/suite/serializeScopeFixture.ts index 2bc9f94fc..c4d9c0912 100644 --- a/packages/cursorless-vscode-e2e/src/suite/serializeScopeFixture.ts +++ b/packages/cursorless-vscode-e2e/src/suite/serializeScopeFixture.ts @@ -1,4 +1,4 @@ -import { +import type { IterationScopeRanges, Range, ScopeRanges, diff --git a/packages/cursorless-vscode-e2e/src/suite/serializeTargetRange.ts b/packages/cursorless-vscode-e2e/src/suite/serializeTargetRange.ts index f391ad0bc..c80b45242 100644 --- a/packages/cursorless-vscode-e2e/src/suite/serializeTargetRange.ts +++ b/packages/cursorless-vscode-e2e/src/suite/serializeTargetRange.ts @@ -1,4 +1,4 @@ -import { Range } from "@cursorless/common"; +import type { Range } from "@cursorless/common"; /** * Given the code of a fixture and a range, return a string that annotates the diff --git a/packages/cursorless-vscode-e2e/src/suite/setupFake.ts b/packages/cursorless-vscode-e2e/src/suite/setupFake.ts index 7e90a3838..e1f161700 100644 --- a/packages/cursorless-vscode-e2e/src/suite/setupFake.ts +++ b/packages/cursorless-vscode-e2e/src/suite/setupFake.ts @@ -1,4 +1,4 @@ -import { HatStability, NormalizedIDE } from "@cursorless/common"; +import type { HatStability, NormalizedIDE } from "@cursorless/common"; export function setupFake(ide: NormalizedIDE, hatStability: HatStability) { ide.configuration.mockConfiguration("experimental", { diff --git a/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts index 971aa9550..4af79a466 100644 --- a/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts @@ -1,8 +1,5 @@ -import { - HatTokenMap, - LATEST_VERSION, - SimpleActionName, -} from "@cursorless/common"; +import type { HatTokenMap, SimpleActionName } from "@cursorless/common"; +import { LATEST_VERSION } from "@cursorless/common"; import { getFixturePath, getRecordedTestsDirPath, diff --git a/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts index c1e775e92..3571c56d5 100644 --- a/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts @@ -1,7 +1,6 @@ +import type { SpyIDE, TestCaseFixtureLegacy } from "@cursorless/common"; import { LATEST_VERSION, - SpyIDE, - TestCaseFixtureLegacy, asyncSafety, getSnapshotForComparison, sleep, diff --git a/packages/cursorless-vscode-tutorial-webview/src/App.tsx b/packages/cursorless-vscode-tutorial-webview/src/App.tsx index f2076c210..f3e72c477 100644 --- a/packages/cursorless-vscode-tutorial-webview/src/App.tsx +++ b/packages/cursorless-vscode-tutorial-webview/src/App.tsx @@ -1,6 +1,6 @@ -import { TutorialState } from "@cursorless/common"; +import type { TutorialState } from "@cursorless/common"; import { useEffect, useState, type FunctionComponent } from "react"; -import { WebviewApi } from "vscode-webview"; +import type { WebviewApi } from "vscode-webview"; import { TutorialStep } from "./TutorialStep"; import { Command } from "./Command"; diff --git a/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx b/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx index faa262812..e7be996d6 100644 --- a/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx +++ b/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx @@ -1,6 +1,6 @@ -import { ActiveTutorialNoErrorsState } from "@cursorless/common"; +import type { ActiveTutorialNoErrorsState } from "@cursorless/common"; import { type FunctionComponent } from "react"; -import { WebviewApi } from "vscode-webview"; +import type { WebviewApi } from "vscode-webview"; import { ArrowLeftIcon } from "./ArrowLeftIcon"; import { ArrowRightIcon } from "./ArrowRightIcon"; import { CloseIcon } from "./CloseIcon"; diff --git a/packages/cursorless-vscode/src/ReleaseNotes.test.ts b/packages/cursorless-vscode/src/ReleaseNotes.test.ts index 0efaa1f75..caf781cfe 100644 --- a/packages/cursorless-vscode/src/ReleaseNotes.test.ts +++ b/packages/cursorless-vscode/src/ReleaseNotes.test.ts @@ -1,8 +1,9 @@ import * as sinon from "sinon"; -import { MessageType, Messages, asyncSafety } from "@cursorless/common"; +import type { MessageType, Messages } from "@cursorless/common"; +import { asyncSafety } from "@cursorless/common"; import type { ExtensionContext, Uri } from "vscode"; import { ReleaseNotes, VERSION_KEY, WHATS_NEW } from "./ReleaseNotes"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { VscodeApi } from "@cursorless/vscode-common"; interface Input { /** Whether the VSCode window is focused */ diff --git a/packages/cursorless-vscode/src/ReleaseNotes.ts b/packages/cursorless-vscode/src/ReleaseNotes.ts index b8f989d71..dc16ca23b 100644 --- a/packages/cursorless-vscode/src/ReleaseNotes.ts +++ b/packages/cursorless-vscode/src/ReleaseNotes.ts @@ -1,7 +1,8 @@ import type { ExtensionContext } from "vscode"; -import { Messages, showInfo } from "@cursorless/common"; +import type { Messages } from "@cursorless/common"; +import { showInfo } from "@cursorless/common"; import * as semver from "semver"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { VscodeApi } from "@cursorless/vscode-common"; import { URI } from "vscode-uri"; /** diff --git a/packages/cursorless-vscode/src/ScopeTreeProvider.ts b/packages/cursorless-vscode/src/ScopeTreeProvider.ts index df57e0f19..62ba11334 100644 --- a/packages/cursorless-vscode/src/ScopeTreeProvider.ts +++ b/packages/cursorless-vscode/src/ScopeTreeProvider.ts @@ -1,14 +1,16 @@ -import { - CURSORLESS_SCOPE_TREE_VIEW_ID, +import type { CursorlessCommandId, ScopeProvider, - ScopeSupport, ScopeSupportInfo, ScopeTypeInfo, +} from "@cursorless/common"; +import { + CURSORLESS_SCOPE_TREE_VIEW_ID, + ScopeSupport, disposableFrom, } from "@cursorless/common"; -import { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { CustomSpokenFormGenerator } from "@cursorless/cursorless-engine"; +import type { VscodeApi } from "@cursorless/vscode-common"; import { isEqual } from "lodash-es"; import type { Disposable, @@ -29,7 +31,7 @@ import { window, } from "vscode"; import { URI } from "vscode-uri"; -import { +import type { ScopeVisualizer, VisualizationType, } from "./ScopeVisualizerCommandApi"; diff --git a/packages/cursorless-vscode/src/ScopeVisualizerCommandApi.ts b/packages/cursorless-vscode/src/ScopeVisualizerCommandApi.ts index 561776fe8..3c0d04c95 100644 --- a/packages/cursorless-vscode/src/ScopeVisualizerCommandApi.ts +++ b/packages/cursorless-vscode/src/ScopeVisualizerCommandApi.ts @@ -1,4 +1,4 @@ -import { Disposable, ScopeType } from "@cursorless/common"; +import type { Disposable, ScopeType } from "@cursorless/common"; export type ScopeVisualizerListener = ( scopeType: ScopeType | undefined, diff --git a/packages/cursorless-vscode/src/SpyWebviewView.ts b/packages/cursorless-vscode/src/SpyWebviewView.ts index 6b63958c3..571df057c 100644 --- a/packages/cursorless-vscode/src/SpyWebviewView.ts +++ b/packages/cursorless-vscode/src/SpyWebviewView.ts @@ -1,7 +1,7 @@ -import { Disposable } from "@cursorless/common"; +import type { Disposable } from "@cursorless/common"; import { cloneDeep } from "lodash-es"; -import { Uri, Webview, WebviewView } from "vscode"; -import { SpyWebViewEvent } from "@cursorless/vscode-common"; +import type { Uri, Webview, WebviewView } from "vscode"; +import type { SpyWebViewEvent } from "@cursorless/vscode-common"; /** * Wraps a {@link WebviewView} and provides a way to spy on its events for diff --git a/packages/cursorless-vscode/src/VscodeSnippets.ts b/packages/cursorless-vscode/src/VscodeSnippets.ts index 70d3d2cd7..37bbae3ad 100644 --- a/packages/cursorless-vscode/src/VscodeSnippets.ts +++ b/packages/cursorless-vscode/src/VscodeSnippets.ts @@ -1,10 +1,5 @@ -import { - mergeStrict, - showError, - Snippet, - SnippetMap, - type IDE, -} from "@cursorless/common"; +import type { Snippet, SnippetMap } from "@cursorless/common"; +import { mergeStrict, showError, type IDE } from "@cursorless/common"; import { mergeSnippets, type Snippets } from "@cursorless/cursorless-engine"; import { walkFiles } from "@cursorless/node-common"; import { max } from "lodash-es"; diff --git a/packages/cursorless-vscode/src/VscodeTutorial.ts b/packages/cursorless-vscode/src/VscodeTutorial.ts index 4b5eed19a..625116766 100644 --- a/packages/cursorless-vscode/src/VscodeTutorial.ts +++ b/packages/cursorless-vscode/src/VscodeTutorial.ts @@ -1,19 +1,18 @@ -import { FileSystem, TutorialId, TutorialState } from "@cursorless/common"; +import type { FileSystem, TutorialId, TutorialState } from "@cursorless/common"; import { getCursorlessRepoRoot } from "@cursorless/node-common"; -import { SpyWebViewEvent, VscodeApi } from "@cursorless/vscode-common"; +import type { SpyWebViewEvent, VscodeApi } from "@cursorless/vscode-common"; import path from "node:path"; -import { +import type { CancellationToken, ExtensionContext, - ExtensionMode, - Uri, WebviewView, WebviewViewProvider, WebviewViewResolveContext, } from "vscode"; -import { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; +import { ExtensionMode, Uri } from "vscode"; +import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; import { SpyWebviewView } from "./SpyWebviewView"; -import { Tutorial } from "@cursorless/cursorless-tutorial"; +import type { Tutorial } from "@cursorless/cursorless-tutorial"; const VSCODE_TUTORIAL_WEBVIEW_ID = "cursorless.tutorial"; diff --git a/packages/cursorless-vscode/src/constructTestHelpers.ts b/packages/cursorless-vscode/src/constructTestHelpers.ts index 43ce56c2b..76d51b48e 100644 --- a/packages/cursorless-vscode/src/constructTestHelpers.ts +++ b/packages/cursorless-vscode/src/constructTestHelpers.ts @@ -1,4 +1,4 @@ -import { +import type { ExcludableSnapshotField, ExtraSnapshotField, FakeCommandServerApi, @@ -12,18 +12,16 @@ import { TestCaseSnapshot, TextEditor, } from "@cursorless/common"; -import { - StoredTargetMap, - plainObjectToTarget, -} from "@cursorless/cursorless-engine"; -import { VscodeTestHelpers } from "@cursorless/vscode-common"; -import * as vscode from "vscode"; +import type { StoredTargetMap } from "@cursorless/cursorless-engine"; +import { plainObjectToTarget } from "@cursorless/cursorless-engine"; +import type { VscodeTestHelpers } from "@cursorless/vscode-common"; +import type * as vscode from "vscode"; import { takeSnapshot } from "@cursorless/test-case-recorder"; -import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; -import { VscodeIDE } from "./ide/vscode/VscodeIDE"; +import type { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; +import type { VscodeIDE } from "./ide/vscode/VscodeIDE"; import { toVscodeEditor } from "./ide/vscode/toVscodeEditor"; import { vscodeApi } from "./vscodeApi"; -import { VscodeTutorial } from "./VscodeTutorial"; +import type { VscodeTutorial } from "./VscodeTutorial"; export function constructTestHelpers( commandServerApi: FakeCommandServerApi, diff --git a/packages/cursorless-vscode/src/createTutorial.ts b/packages/cursorless-vscode/src/createTutorial.ts index 14de06751..fd7c573ba 100644 --- a/packages/cursorless-vscode/src/createTutorial.ts +++ b/packages/cursorless-vscode/src/createTutorial.ts @@ -1,14 +1,14 @@ -import { Hats, HatTokenMap, IDE } from "@cursorless/common"; -import { +import type { Hats, HatTokenMap, IDE } from "@cursorless/common"; +import type { CommandRunnerDecorator, CustomSpokenFormGenerator, } from "@cursorless/cursorless-engine"; import { TutorialImpl } from "@cursorless/cursorless-tutorial"; import { FileSystemTutorialContentProvider } from "@cursorless/node-common"; -import * as vscode from "vscode"; -import { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; +import type * as vscode from "vscode"; +import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; import { VscodeTutorial } from "./VscodeTutorial"; -import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; +import type { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; import { vscodeApi } from "./vscodeApi"; export function createTutorial( diff --git a/packages/cursorless-vscode/src/extension.ts b/packages/cursorless-vscode/src/extension.ts index ef2be3440..6ba1dce60 100644 --- a/packages/cursorless-vscode/src/extension.ts +++ b/packages/cursorless-vscode/src/extension.ts @@ -1,19 +1,21 @@ -import { +import type { Disposable, EnforceUndefined, - FakeCommandServerApi, - FakeIDE, IDE, - NormalizedIDE, Range, ScopeProvider, ScopeType, TextDocument, - type TreeSitter, } from "@cursorless/common"; +import { + FakeCommandServerApi, + FakeIDE, + NormalizedIDE, + type TreeSitter, +} from "@cursorless/common"; +import type { EngineProps } from "@cursorless/cursorless-engine"; import { CommandHistory, - EngineProps, createCursorlessEngine, } from "@cursorless/cursorless-engine"; import { @@ -26,9 +28,8 @@ import { ScopeTestRecorder, TestCaseRecorder, } from "@cursorless/test-case-recorder"; +import type { CursorlessApi, ParseTreeApi } from "@cursorless/vscode-common"; import { - CursorlessApi, - ParseTreeApi, getCommandServerApi, getParseTreeApi, toVscodeRange, @@ -39,7 +40,7 @@ import * as path from "node:path"; import * as vscode from "vscode"; import { ReleaseNotes } from "./ReleaseNotes"; import { ScopeTreeProvider } from "./ScopeTreeProvider"; -import { +import type { ScopeVisualizer, ScopeVisualizerListener, VisualizationType, @@ -48,10 +49,8 @@ import { StatusBarItem } from "./StatusBarItem"; import { VscodeSnippets } from "./VscodeSnippets"; import { constructTestHelpers } from "./constructTestHelpers"; import { createTutorial } from "./createTutorial"; -import { - VscodeScopeVisualizer, - createVscodeScopeVisualizer, -} from "./ide/vscode/VSCodeScopeVisualizer"; +import type { VscodeScopeVisualizer } from "./ide/vscode/VSCodeScopeVisualizer"; +import { createVscodeScopeVisualizer } from "./ide/vscode/VSCodeScopeVisualizer"; import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; import { VscodeIDE } from "./ide/vscode/VscodeIDE"; import { FakeFontMeasurements } from "./ide/vscode/hats/FakeFontMeasurements"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts index ca4c7a992..80f1b6052 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts @@ -1,12 +1,13 @@ -import { GeneralizedRange, Range } from "@cursorless/common"; +import type { GeneralizedRange } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { flatmap } from "itertools"; -import { VscodeTextEditorImpl } from "../../VscodeTextEditorImpl"; -import { RangeTypeColors } from "../RangeTypeColors"; +import type { VscodeTextEditorImpl } from "../../VscodeTextEditorImpl"; +import type { RangeTypeColors } from "../RangeTypeColors"; import { VscodeFancyRangeHighlighterRenderer } from "./VscodeFancyRangeHighlighterRenderer"; import { generateDecorationsForCharacterRange } from "./generateDecorationsForCharacterRange"; import { generateDecorationsForLineRange } from "./generateDecorationsForLineRange"; import { generateDifferentiatedRanges } from "./generateDifferentiatedRanges"; -import { DifferentiatedStyledRange } from "./decorationStyle.types"; +import type { DifferentiatedStyledRange } from "./decorationStyle.types"; import { groupDifferentiatedStyledRanges } from "./groupDifferentiatedStyledRanges"; /** diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts index a466d4155..f79e4455e 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts @@ -1,19 +1,16 @@ import { CompositeKeyDefaultMap } from "@cursorless/common"; import { toVscodeRange } from "@cursorless/vscode-common"; -import { - DecorationRangeBehavior, - DecorationRenderOptions, - TextEditorDecorationType, -} from "vscode"; +import type { DecorationRenderOptions, TextEditorDecorationType } from "vscode"; +import { DecorationRangeBehavior } from "vscode"; import { vscodeApi } from "../../../../vscodeApi"; -import { VscodeTextEditorImpl } from "../../VscodeTextEditorImpl"; -import { RangeTypeColors } from "../RangeTypeColors"; -import { - BorderStyle, +import type { VscodeTextEditorImpl } from "../../VscodeTextEditorImpl"; +import type { RangeTypeColors } from "../RangeTypeColors"; +import type { DecorationStyle, DifferentiatedStyle, DifferentiatedStyledRangeList, } from "./decorationStyle.types"; +import { BorderStyle } from "./decorationStyle.types"; import { getDifferentiatedStyleMapKey } from "./getDifferentiatedStyleMapKey"; const BORDER_WIDTH = "1px"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/decorationStyle.types.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/decorationStyle.types.ts index f20c439cd..832e995ce 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/decorationStyle.types.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/decorationStyle.types.ts @@ -1,4 +1,4 @@ -import { GeneralizedRange, Range } from "@cursorless/common"; +import type { GeneralizedRange, Range } from "@cursorless/common"; export enum BorderStyle { porous = "dashed", diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateDecorationsForCharacterRange.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateDecorationsForCharacterRange.ts index 0cebef7d0..b09c537d4 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateDecorationsForCharacterRange.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateDecorationsForCharacterRange.ts @@ -1,5 +1,7 @@ -import { Range, TextEditor, getLineRanges } from "@cursorless/common"; -import { BorderStyle, StyledRange } from "../decorationStyle.types"; +import type { Range, TextEditor } from "@cursorless/common"; +import { getLineRanges } from "@cursorless/common"; +import type { StyledRange } from "../decorationStyle.types"; +import { BorderStyle } from "../decorationStyle.types"; import { handleMultipleLines } from "./handleMultipleLines"; /** diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateLineInfos.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateLineInfos.ts index 9202923d0..b8ea3b499 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateLineInfos.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/generateLineInfos.ts @@ -1,4 +1,4 @@ -import { Range } from "@cursorless/common"; +import type { Range } from "@cursorless/common"; /** * Generates a line info for each line in the given range, which includes diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/handleMultipleLines.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/handleMultipleLines.ts index 95c836502..d1c537a68 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/handleMultipleLines.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForCharacterRange/handleMultipleLines.ts @@ -1,11 +1,9 @@ import { Range } from "@cursorless/common"; -import { - BorderStyle, - DecorationStyle, - StyledRange, -} from "../decorationStyle.types"; +import type { DecorationStyle, StyledRange } from "../decorationStyle.types"; +import { BorderStyle } from "../decorationStyle.types"; import { flatmap } from "itertools"; -import { generateLineInfos, LineInfo } from "./generateLineInfos"; +import type { LineInfo } from "./generateLineInfos"; +import { generateLineInfos } from "./generateLineInfos"; /** * Generates decorations for a range, which has already been split up into line diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForLineRange.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForLineRange.ts index 23ac9a6d3..c1b79c2f4 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForLineRange.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDecorationsForLineRange.ts @@ -1,5 +1,6 @@ import { Range } from "@cursorless/common"; -import { BorderStyle, StyledRange } from "./decorationStyle.types"; +import type { StyledRange } from "./decorationStyle.types"; +import { BorderStyle } from "./decorationStyle.types"; export function* generateDecorationsForLineRange( startLine: number, diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts index bba222251..12cb17e6f 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts @@ -1,11 +1,11 @@ +import type { GeneralizedRange } from "@cursorless/common"; import { - GeneralizedRange, generalizedRangeContains, generalizedRangeTouches, } from "@cursorless/common"; import { max } from "lodash-es"; -import { DifferentiatedGeneralizedRange } from "./decorationStyle.types"; +import type { DifferentiatedGeneralizedRange } from "./decorationStyle.types"; /** * Given a list of generalized ranges, returns a list of differentiated ranges, diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/getDifferentiatedStyleMapKey.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/getDifferentiatedStyleMapKey.ts index 4bda9d458..5a0cee93c 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/getDifferentiatedStyleMapKey.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/getDifferentiatedStyleMapKey.ts @@ -1,4 +1,4 @@ -import { DifferentiatedStyle } from "./decorationStyle.types"; +import type { DifferentiatedStyle } from "./decorationStyle.types"; /** * Returns a list of values that uniquely definees a differentiated style, for diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/groupDifferentiatedStyledRanges.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/groupDifferentiatedStyledRanges.ts index 22f692f04..c72f2dc35 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/groupDifferentiatedStyledRanges.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/groupDifferentiatedStyledRanges.ts @@ -1,5 +1,5 @@ import { CompositeKeyDefaultMap } from "@cursorless/common"; -import { +import type { DifferentiatedStyle, DifferentiatedStyledRange, DifferentiatedStyledRangeList, diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeIterationScopeVisualizer.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeIterationScopeVisualizer.ts index da3dca3fe..d8b25979d 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeIterationScopeVisualizer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeIterationScopeVisualizer.ts @@ -1,10 +1,6 @@ -import { - Disposable, - ScopeSupport, - TextEditor, - toCharacterRange, -} from "@cursorless/common"; -import { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; +import type { Disposable, ScopeSupport, TextEditor } from "@cursorless/common"; +import { toCharacterRange } from "@cursorless/common"; +import type { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; import { VscodeScopeVisualizer } from "./VscodeScopeVisualizer"; export class VscodeIterationScopeVisualizer extends VscodeScopeVisualizer { diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts index c9004dab5..fbba4bfc9 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts @@ -1,10 +1,7 @@ -import { - Disposable, - GeneralizedRange, - isGeneralizedRangeEqual, -} from "@cursorless/common"; -import { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; -import { RangeTypeColors } from "./RangeTypeColors"; +import type { Disposable, GeneralizedRange } from "@cursorless/common"; +import { isGeneralizedRangeEqual } from "@cursorless/common"; +import type { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; +import type { RangeTypeColors } from "./RangeTypeColors"; import { VscodeFancyRangeHighlighter } from "./VscodeFancyRangeHighlighter"; import { blendRangeTypeColors } from "./blendRangeTypeColors"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts index ae5c4eb21..4105a3cc7 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts @@ -1,13 +1,13 @@ -import { +import type { Disposable, GeneralizedRange, ScopeSupport, TargetRanges, TextEditor, - toCharacterRange, } from "@cursorless/common"; +import { toCharacterRange } from "@cursorless/common"; import { VscodeScopeVisualizer } from "./VscodeScopeVisualizer"; -import { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; +import type { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; abstract class VscodeScopeTargetVisualizer extends VscodeScopeVisualizer { protected abstract getTargetRange( diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts index 84346dce7..0ab33c9b0 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts @@ -1,13 +1,12 @@ -import { +import type { Disposable, IDE, ScopeProvider, - ScopeSupport, ScopeType, TextEditor, - showError, } from "@cursorless/common"; -import { +import { ScopeSupport, showError } from "@cursorless/common"; +import type { ScopeRangeType, ScopeVisualizerColorConfig, } from "@cursorless/vscode-common"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/blendRangeTypeColors.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/blendRangeTypeColors.ts index 6d1683710..ad8a499df 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/blendRangeTypeColors.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/blendRangeTypeColors.ts @@ -1,5 +1,5 @@ import tinycolor from "tinycolor2"; -import { RangeTypeColors } from "./RangeTypeColors"; +import type { RangeTypeColors } from "./RangeTypeColors"; /** * Blends two {@link RangeTypeColors} color configurations together according to diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/createVscodeScopeVisualizer.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/createVscodeScopeVisualizer.ts index aad6cd3ec..204f3854b 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/createVscodeScopeVisualizer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/createVscodeScopeVisualizer.ts @@ -1,5 +1,5 @@ -import { IDE, ScopeProvider, ScopeType } from "@cursorless/common"; -import { VisualizationType } from "../../../ScopeVisualizerCommandApi"; +import type { IDE, ScopeProvider, ScopeType } from "@cursorless/common"; +import type { VisualizationType } from "../../../ScopeVisualizerCommandApi"; import { VscodeIterationScopeVisualizer } from "./VscodeIterationScopeVisualizer"; import { VscodeScopeContentVisualizer, diff --git a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/getColorsFromConfig.ts b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/getColorsFromConfig.ts index 862767b31..8c6d48fbf 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/getColorsFromConfig.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VSCodeScopeVisualizer/getColorsFromConfig.ts @@ -1,8 +1,8 @@ -import { +import type { ScopeRangeType, ScopeVisualizerColorConfig, } from "@cursorless/vscode-common"; -import { RangeTypeColors } from "./RangeTypeColors"; +import type { RangeTypeColors } from "./RangeTypeColors"; export function getColorsFromConfig( config: ScopeVisualizerColorConfig, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeCapabilities.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeCapabilities.ts index 4f46ce9f1..99ad6ee00 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeCapabilities.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeCapabilities.ts @@ -1,4 +1,4 @@ -import { Capabilities, CommandCapabilityMap } from "@cursorless/common"; +import type { Capabilities, CommandCapabilityMap } from "@cursorless/common"; const COMMAND_CAPABILITIES: CommandCapabilityMap = { clipboardPaste: true, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeClipboard.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeClipboard.ts index 95556fedc..4c0531e1a 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeClipboard.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeClipboard.ts @@ -1,5 +1,5 @@ import * as vscode from "vscode"; -import { Clipboard } from "@cursorless/common"; +import type { Clipboard } from "@cursorless/common"; export default class VscodeClipboard implements Clipboard { async readText(): Promise { diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeConfiguration.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeConfiguration.ts index 232e6734f..0581a5b03 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeConfiguration.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeConfiguration.ts @@ -1,12 +1,12 @@ import * as os from "node:os"; import { HatStability } from "@cursorless/common"; import * as vscode from "vscode"; -import { +import type { Configuration, ConfigurationScope, CursorlessConfiguration, } from "@cursorless/common"; -import { GetFieldType, Paths } from "@cursorless/common"; +import type { GetFieldType, Paths } from "@cursorless/common"; import { Notifier } from "@cursorless/common"; import type { VscodeIDE } from "./VscodeIDE"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeEdit.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeEdit.ts index 48556be83..0531f26d3 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeEdit.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeEdit.ts @@ -1,4 +1,4 @@ -import { Edit } from "@cursorless/common"; +import type { Edit } from "@cursorless/common"; import { toVscodePosition, toVscodeRange } from "@cursorless/vscode-common"; import type * as vscode from "vscode"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts index 38e8e9331..720630b31 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts @@ -1,14 +1,10 @@ import { pickBy } from "lodash-es"; import * as vscode from "vscode"; -import { HatStyleInfo, HatStyleMap } from "@cursorless/common"; -import { Listener, Notifier } from "@cursorless/common"; -import { - HatColor, - HatShape, - HAT_COLORS, - HAT_NON_DEFAULT_SHAPES, - VscodeHatStyleName, -} from "./hatStyles.types"; +import type { HatStyleInfo, HatStyleMap } from "@cursorless/common"; +import type { Listener } from "@cursorless/common"; +import { Notifier } from "@cursorless/common"; +import type { HatColor, HatShape, VscodeHatStyleName } from "./hatStyles.types"; +import { HAT_COLORS, HAT_NON_DEFAULT_SHAPES } from "./hatStyles.types"; export interface ExtendedHatStyleInfo extends HatStyleInfo { color: HatColor; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeEvents.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeEvents.ts index 395527e3c..7afd189f4 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeEvents.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeEvents.ts @@ -5,7 +5,7 @@ import type { TextDocumentChangeReason, TextDocumentContentChangeEvent, } from "@cursorless/common"; -import { Event } from "@cursorless/common"; +import type { Event } from "@cursorless/common"; import type { Disposable } from "@cursorless/common"; import { VscodeTextDocumentImpl } from "./VscodeTextDocumentImpl"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts index 2f06085cc..d755068bd 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeFileSystem.ts @@ -1,4 +1,4 @@ -import { +import type { Disposable, FileSystem, PathChangeListener, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeFlashHandler.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeFlashHandler.ts index 700003abf..2cf56f71b 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeFlashHandler.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeFlashHandler.ts @@ -1,13 +1,12 @@ -import { +import type { EditorGeneralizedRange, FlashDescriptor, FlashStyle, - groupBy, - sleep, } from "@cursorless/common"; +import { groupBy, sleep } from "@cursorless/common"; import { workspace } from "vscode"; -import VscodeHighlights from "./VscodeHighlights"; -import { VscodeIDE } from "./VscodeIDE"; +import type VscodeHighlights from "./VscodeHighlights"; +import type { VscodeIDE } from "./VscodeIDE"; export default class VscodeFlashHandler { constructor( diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeFocusEditor.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeFocusEditor.ts index ef7b65874..0352d3156 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeFocusEditor.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeFocusEditor.ts @@ -1,14 +1,8 @@ import { getCellIndex } from "@cursorless/vscode-common"; -import { - commands, - NotebookDocument, - TabInputTextDiff, - TextEditor, - ViewColumn, - window, -} from "vscode"; +import type { NotebookDocument, TextEditor } from "vscode"; +import { commands, TabInputTextDiff, ViewColumn, window } from "vscode"; import { getNotebookFromCellDocument } from "./notebook/notebook"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; const columnFocusCommands = { [ViewColumn.One]: "workbench.action.focusFirstEditorGroup", diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeFold.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeFold.ts index d8041ed8c..d2a0a9354 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeFold.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeFold.ts @@ -1,7 +1,7 @@ -import { Range } from "@cursorless/common"; +import type { Range } from "@cursorless/common"; import * as vscode from "vscode"; -import { VscodeIDE } from "./VscodeIDE"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { VscodeIDE } from "./VscodeIDE"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export async function vscodeFold( ide: VscodeIDE, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeHighlightDecorationTypes.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeHighlightDecorationTypes.ts index da8665a58..a7cb2e343 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeHighlightDecorationTypes.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeHighlightDecorationTypes.ts @@ -1,10 +1,5 @@ -import { - DecorationRangeBehavior, - DecorationRenderOptions, - TextEditorDecorationType, - ThemeColor, - window, -} from "vscode"; +import type { DecorationRenderOptions, TextEditorDecorationType } from "vscode"; +import { DecorationRangeBehavior, ThemeColor, window } from "vscode"; import type { VscodeStyle } from "./VscodeHighlights"; /** diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeHighlights.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeHighlights.ts index 6f7388c05..54a9390ff 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeHighlights.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeHighlights.ts @@ -1,14 +1,14 @@ import * as vscode from "vscode"; -import { ExtensionContext } from "vscode"; +import type { ExtensionContext } from "vscode"; import { FlashStyle, partition } from "@cursorless/common"; -import { +import type { CharacterRange, GeneralizedRange, - isLineRange, LineRange, } from "@cursorless/common"; +import { isLineRange } from "@cursorless/common"; import { VscodeHighlightDecorationTypes } from "./VscodeHighlightDecorationTypes"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export enum HighlightStyle { highlight0 = "highlight0", diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeIDE.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeIDE.ts index 7457056b6..e288521dd 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeIDE.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeIDE.ts @@ -1,4 +1,4 @@ -import { +import type { Disposable, EditableTextEditor, FlashDescriptor, @@ -7,12 +7,12 @@ import { IDE, InputBoxOptions, OpenUntitledTextDocumentOptions, - OutdatedExtensionError, QuickPickOptions, RunMode, TextDocumentChangeEvent, TextEditor, } from "@cursorless/common"; +import { OutdatedExtensionError } from "@cursorless/common"; import { fromVscodeRange, fromVscodeSelection, @@ -20,7 +20,8 @@ import { import { pull } from "lodash-es"; import { v4 as uuid } from "uuid"; import * as vscode from "vscode"; -import { ExtensionContext, WorkspaceFolder, window, workspace } from "vscode"; +import type { ExtensionContext, WorkspaceFolder } from "vscode"; +import { window, workspace } from "vscode"; import { VscodeCapabilities } from "./VscodeCapabilities"; import VscodeClipboard from "./VscodeClipboard"; import VscodeConfiguration from "./VscodeConfiguration"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeInsertSnippets.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeInsertSnippets.ts index 0f8c5e603..67f88878a 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeInsertSnippets.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeInsertSnippets.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; -import { Range } from "@cursorless/common"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { Range } from "@cursorless/common"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export async function vscodeInsertSnippet( editor: VscodeTextEditorImpl, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeMessages.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeMessages.ts index 1bcd35d30..07dd5e7ad 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeMessages.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeMessages.ts @@ -1,5 +1,6 @@ import { window } from "vscode"; -import { MessageId, Messages, MessageType } from "@cursorless/common"; +import type { MessageId, Messages } from "@cursorless/common"; +import { MessageType } from "@cursorless/common"; export default class VscodeMessages implements Messages { async showMessage( diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeNotebooks.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeNotebooks.ts index b4c8d0fcf..e89a1da00 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeNotebooks.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeNotebooks.ts @@ -1,7 +1,7 @@ import { Selection } from "@cursorless/common"; import * as vscode from "vscode"; import { getNotebookFromCellDocument } from "./notebook/notebook"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export async function vscodeEditNewNotebookCellAbove( editor: VscodeTextEditorImpl, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeOpenLink.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeOpenLink.ts index d05c1eb9b..ada306218 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeOpenLink.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeOpenLink.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; -import { OpenLinkOptions, Range } from "@cursorless/common"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { OpenLinkOptions, Range } from "@cursorless/common"; import { toVscodePositionOrRange } from "@cursorless/vscode-common"; export default async function vscodeOpenLink( diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeRevealLine.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeRevealLine.ts index 8c525cda0..dfedb8fd7 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeRevealLine.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeRevealLine.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; import { RevealLineAt } from "@cursorless/common"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export async function vscodeRevealLine( editor: VscodeTextEditorImpl, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeRunMode.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeRunMode.ts index 4110d6ee9..2c1dd0a1a 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeRunMode.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeRunMode.ts @@ -1,4 +1,5 @@ -import { ExtensionContext, ExtensionMode } from "vscode"; +import type { ExtensionContext } from "vscode"; +import { ExtensionMode } from "vscode"; import type { RunMode } from "@cursorless/common"; import { nodeGetRunMode } from "@cursorless/node-common"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts index b01ca1a89..a819673a8 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeTextDocumentImpl.ts @@ -1,10 +1,10 @@ -import { +import type { EndOfLine, Position, - Range, TextDocument, TextLine, } from "@cursorless/common"; +import { Range } from "@cursorless/common"; import { fromVscodeEndOfLine, fromVscodePosition, @@ -12,7 +12,7 @@ import { toVscodeRange, } from "@cursorless/vscode-common"; import * as path from "node:path"; -import * as vscode from "vscode"; +import type * as vscode from "vscode"; import type { URI } from "vscode-uri"; import VscodeTextLineImpl from "./VscodeTextLineImpl"; diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeTextEditorImpl.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeTextEditorImpl.ts index 4078130e9..68ca2ca10 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeTextEditorImpl.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeTextEditorImpl.ts @@ -1,4 +1,4 @@ -import { +import type { BreakpointDescriptor, Edit, EditableTextEditor, @@ -7,12 +7,11 @@ import { RevealLineAt, Selection, SetSelectionsOpts, - sleep, TextDocument, TextEditor, TextEditorOptions, - uniqWithHash, } from "@cursorless/common"; +import { sleep, uniqWithHash } from "@cursorless/common"; import { fromVscodeRange, fromVscodeSelection, @@ -23,7 +22,7 @@ import * as vscode from "vscode"; import vscodeEdit from "./VscodeEdit"; import vscodeFocusEditor from "./VscodeFocusEditor"; import { vscodeFold, vscodeUnfold } from "./VscodeFold"; -import { VscodeIDE } from "./VscodeIDE"; +import type { VscodeIDE } from "./VscodeIDE"; import { vscodeInsertSnippet } from "./VscodeInsertSnippets"; import { vscodeEditNewNotebookCellAbove, diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeTextLineImpl.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeTextLineImpl.ts index 2f1986287..5e8e217c3 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeTextLineImpl.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeTextLineImpl.ts @@ -1,6 +1,6 @@ -import { Range, TextLine } from "@cursorless/common"; +import type { Range, TextLine } from "@cursorless/common"; import { fromVscodeRange } from "@cursorless/vscode-common"; -import * as vscode from "vscode"; +import type * as vscode from "vscode"; export default class VscodeTextLineImpl implements TextLine { constructor(private line: vscode.TextLine) {} diff --git a/packages/cursorless-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts b/packages/cursorless-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts index 5d50a039d..33248fde8 100644 --- a/packages/cursorless-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts +++ b/packages/cursorless-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts @@ -1,7 +1,7 @@ -import { BreakpointDescriptor } from "@cursorless/common"; +import type { BreakpointDescriptor } from "@cursorless/common"; import { toVscodeRange } from "@cursorless/vscode-common"; import * as vscode from "vscode"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export async function vscodeToggleBreakpoint( editor: VscodeTextEditorImpl, diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/FakeFontMeasurements.ts b/packages/cursorless-vscode/src/ide/vscode/hats/FakeFontMeasurements.ts index 764a3885a..49e1fe749 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/FakeFontMeasurements.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/FakeFontMeasurements.ts @@ -1,4 +1,4 @@ -import { FontMeasurements } from "./FontMeasurements"; +import type { FontMeasurements } from "./FontMeasurements"; export class FakeFontMeasurements implements FontMeasurements { fontSize = 12; diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/FontMeasurementsImpl.ts b/packages/cursorless-vscode/src/ide/vscode/hats/FontMeasurementsImpl.ts index 4b1db39eb..a8a3ff4c4 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/FontMeasurementsImpl.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/FontMeasurementsImpl.ts @@ -1,5 +1,5 @@ import * as vscode from "vscode"; -import { FontMeasurements } from "./FontMeasurements"; +import type { FontMeasurements } from "./FontMeasurements"; /** * Contains measurements for the user's font diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts b/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts index 0edf9b017..008f1149e 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts @@ -1,27 +1,27 @@ -import { +import type { Listener, Messages, - Notifier, PathChangeListener, } from "@cursorless/common"; +import { Notifier } from "@cursorless/common"; import { walkFiles } from "@cursorless/node-common"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { VscodeApi } from "@cursorless/vscode-common"; import * as fs from "node:fs/promises"; import { cloneDeep, isEqual } from "lodash-es"; import * as path from "node:path"; import * as vscode from "vscode"; import { vscodeGetConfigurationString } from "../VscodeConfiguration"; -import VscodeEnabledHatStyleManager, { - ExtendedHatStyleMap, -} from "../VscodeEnabledHatStyleManager"; -import { HAT_SHAPES, HatShape, VscodeHatStyleName } from "../hatStyles.types"; -import { FontMeasurements } from "./FontMeasurements"; +import type { ExtendedHatStyleMap } from "../VscodeEnabledHatStyleManager"; +import type VscodeEnabledHatStyleManager from "../VscodeEnabledHatStyleManager"; +import type { HatShape, VscodeHatStyleName } from "../hatStyles.types"; +import { HAT_SHAPES } from "../hatStyles.types"; +import type { FontMeasurements } from "./FontMeasurements"; import getHatThemeColors from "./getHatThemeColors"; import { performPr1868ShapeUpdateInit } from "./performPr1868ShapeUpdateInit"; +import type { IndividualHatAdjustmentMap } from "./shapeAdjustments"; import { DEFAULT_HAT_HEIGHT_EM, DEFAULT_VERTICAL_OFFSET_EM, - IndividualHatAdjustmentMap, defaultShapeAdjustments, } from "./shapeAdjustments"; diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHats.ts b/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHats.ts index 4cf9dd310..4266d36b5 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHats.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/VscodeHats.ts @@ -1,21 +1,22 @@ -import { +import type { HatRange, Hats, HatStyleMap, HatStyleName, Listener, - Notifier, Range, TextEditor, } from "@cursorless/common"; -import { toVscodeRange, VscodeApi } from "@cursorless/vscode-common"; +import { Notifier } from "@cursorless/common"; +import type { VscodeApi } from "@cursorless/vscode-common"; +import { toVscodeRange } from "@cursorless/vscode-common"; import * as vscode from "vscode"; -import { Disposable } from "vscode"; -import { VscodeHatStyleName } from "../hatStyles.types"; +import type { Disposable } from "vscode"; +import type { VscodeHatStyleName } from "../hatStyles.types"; import VscodeEnabledHatStyleManager from "../VscodeEnabledHatStyleManager"; import type { VscodeIDE } from "../VscodeIDE"; -import { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; -import { FontMeasurements } from "./FontMeasurements"; +import type { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; +import type { FontMeasurements } from "./FontMeasurements"; import VscodeHatRenderer from "./VscodeHatRenderer"; export class VscodeHats implements Hats { diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/getHatThemeColors.ts b/packages/cursorless-vscode/src/ide/vscode/hats/getHatThemeColors.ts index 4f0000324..aae126255 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/getHatThemeColors.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/getHatThemeColors.ts @@ -1,5 +1,5 @@ import * as vscode from "vscode"; -import { HatColor } from "../hatStyles.types"; +import type { HatColor } from "../hatStyles.types"; interface OldDecorationColorSetting { dark: string; diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/getStyleName.ts b/packages/cursorless-vscode/src/ide/vscode/hats/getStyleName.ts index 80a8f2bde..13e164d5f 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/getStyleName.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/getStyleName.ts @@ -1,4 +1,8 @@ -import { HatColor, HatShape, VscodeHatStyleName } from "../hatStyles.types"; +import type { + HatColor, + HatShape, + VscodeHatStyleName, +} from "../hatStyles.types"; export function getStyleName( color: HatColor, diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts b/packages/cursorless-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts index dbcd4d388..0aab43030 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts @@ -1,8 +1,9 @@ -import { Messages, showInfo } from "@cursorless/common"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { Messages } from "@cursorless/common"; +import { showInfo } from "@cursorless/common"; +import type { VscodeApi } from "@cursorless/vscode-common"; import * as vscode from "vscode"; -import { ExtendedHatStyleMap } from "../VscodeEnabledHatStyleManager"; -import { IndividualHatAdjustmentMap } from "./shapeAdjustments"; +import type { ExtendedHatStyleMap } from "../VscodeEnabledHatStyleManager"; +import type { IndividualHatAdjustmentMap } from "./shapeAdjustments"; /** * We set this key in global state the first time they user gets the new shapes from #1868. We use this to diff --git a/packages/cursorless-vscode/src/ide/vscode/hats/shapeAdjustments.ts b/packages/cursorless-vscode/src/ide/vscode/hats/shapeAdjustments.ts index 042341f16..d0e978d42 100644 --- a/packages/cursorless-vscode/src/ide/vscode/hats/shapeAdjustments.ts +++ b/packages/cursorless-vscode/src/ide/vscode/hats/shapeAdjustments.ts @@ -1,4 +1,4 @@ -import { HatShape } from "../hatStyles.types"; +import type { HatShape } from "../hatStyles.types"; export interface HatAdjustments { sizeAdjustment?: number; diff --git a/packages/cursorless-vscode/src/ide/vscode/isDiffEditorOriginal.ts b/packages/cursorless-vscode/src/ide/vscode/isDiffEditorOriginal.ts index 3d6ab4edd..75b042340 100644 --- a/packages/cursorless-vscode/src/ide/vscode/isDiffEditorOriginal.ts +++ b/packages/cursorless-vscode/src/ide/vscode/isDiffEditorOriginal.ts @@ -1,4 +1,5 @@ -import { TabInputTextDiff, TextEditor, window } from "vscode"; +import type { TextEditor } from "vscode"; +import { TabInputTextDiff, window } from "vscode"; /** * @param editor The editor to check diff --git a/packages/cursorless-vscode/src/ide/vscode/notebook/notebook.ts b/packages/cursorless-vscode/src/ide/vscode/notebook/notebook.ts index 107eafdcf..6c25ec251 100644 --- a/packages/cursorless-vscode/src/ide/vscode/notebook/notebook.ts +++ b/packages/cursorless-vscode/src/ide/vscode/notebook/notebook.ts @@ -1,4 +1,5 @@ -import { TextDocument, window } from "vscode"; +import type { TextDocument } from "vscode"; +import { window } from "vscode"; /** * Given a document corresponding to a single cell, retrieve the notebook diff --git a/packages/cursorless-vscode/src/ide/vscode/notebook/notebookCurrent.ts b/packages/cursorless-vscode/src/ide/vscode/notebook/notebookCurrent.ts index fb4e7d3ed..7b17f5089 100644 --- a/packages/cursorless-vscode/src/ide/vscode/notebook/notebookCurrent.ts +++ b/packages/cursorless-vscode/src/ide/vscode/notebook/notebookCurrent.ts @@ -1,4 +1,5 @@ -import { NotebookCell, TextDocument, window } from "vscode"; +import type { NotebookCell, TextDocument } from "vscode"; +import { window } from "vscode"; /** Gets the notebook containing a text document using >=1.68.0 VSCode notebook api **/ export function getNotebookFromCellDocumentCurrent(document: TextDocument) { diff --git a/packages/cursorless-vscode/src/ide/vscode/toVscodeEditor.ts b/packages/cursorless-vscode/src/ide/vscode/toVscodeEditor.ts index bc01d4efd..ef8fdf79d 100644 --- a/packages/cursorless-vscode/src/ide/vscode/toVscodeEditor.ts +++ b/packages/cursorless-vscode/src/ide/vscode/toVscodeEditor.ts @@ -1,6 +1,6 @@ -import { TextEditor } from "@cursorless/common"; -import * as vscode from "vscode"; -import { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; +import type { TextEditor } from "@cursorless/common"; +import type * as vscode from "vscode"; +import type { VscodeTextEditorImpl } from "./VscodeTextEditorImpl"; export function toVscodeEditor(editor: TextEditor): vscode.TextEditor { if ("vscodeEditor" in editor) { diff --git a/packages/cursorless-vscode/src/ide/vscode/vscodeShowQuickPick.ts b/packages/cursorless-vscode/src/ide/vscode/vscodeShowQuickPick.ts index d17b1d699..eec26dd23 100644 --- a/packages/cursorless-vscode/src/ide/vscode/vscodeShowQuickPick.ts +++ b/packages/cursorless-vscode/src/ide/vscode/vscodeShowQuickPick.ts @@ -1,5 +1,8 @@ import * as vscode from "vscode"; -import { QuickPickOptions, UnknownValuesOptions } from "@cursorless/common"; +import type { + QuickPickOptions, + UnknownValuesOptions, +} from "@cursorless/common"; export async function vscodeShowQuickPick( items: readonly string[], diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardActionType.ts b/packages/cursorless-vscode/src/keyboard/KeyboardActionType.ts index 6cd7bbaf4..797106a52 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardActionType.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardActionType.ts @@ -1,4 +1,5 @@ -import { ActionType, actionNames } from "@cursorless/common"; +import type { ActionType } from "@cursorless/common"; +import { actionNames } from "@cursorless/common"; // This file contains types defining the allowable identifiers for actions in // user keyboard config settings. It is a modified version of the default action diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardCommandHandler.ts b/packages/cursorless-vscode/src/keyboard/KeyboardCommandHandler.ts index 107fd650f..34f9423d8 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardCommandHandler.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardCommandHandler.ts @@ -1,16 +1,19 @@ -import { Modifier, PartialMark, SurroundingPairName } from "@cursorless/common"; +import type { + Modifier, + PartialMark, + SurroundingPairName, +} from "@cursorless/common"; import { surroundingPairsDelimiters } from "@cursorless/cursorless-engine"; import { isString } from "lodash-es"; import * as vscode from "vscode"; -import { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; -import { +import type { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; +import type { SimpleKeyboardActionDescriptor, SpecificKeyboardActionDescriptor, } from "./KeyboardActionType"; -import KeyboardCommandsTargeted, { - TargetingMode, -} from "./KeyboardCommandsTargeted"; -import { ModalVscodeCommandDescriptor } from "./TokenTypes"; +import type { TargetingMode } from "./KeyboardCommandsTargeted"; +import type KeyboardCommandsTargeted from "./KeyboardCommandsTargeted"; +import type { ModalVscodeCommandDescriptor } from "./TokenTypes"; /** * This class defines the keyboard commands available to our modal keyboard diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardCommandTypeHelpers.ts b/packages/cursorless-vscode/src/keyboard/KeyboardCommandTypeHelpers.ts index 2091dfa3f..8b096897c 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardCommandTypeHelpers.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardCommandTypeHelpers.ts @@ -1,4 +1,4 @@ -import { KeyboardCommandHandler } from "./KeyboardCommandHandler"; +import type { KeyboardCommandHandler } from "./KeyboardCommandHandler"; /** * Maps from the name of a method in KeyboardCommandHandler to the type of its diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardCommands.ts b/packages/cursorless-vscode/src/keyboard/KeyboardCommands.ts index e24a77eae..5eac4e4e1 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardCommands.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardCommands.ts @@ -1,9 +1,9 @@ -import { ExtensionContext } from "vscode"; +import type { ExtensionContext } from "vscode"; import KeyboardCommandsModal from "./KeyboardCommandsModal"; import KeyboardCommandsTargeted from "./KeyboardCommandsTargeted"; import KeyboardHandler from "./KeyboardHandler"; -import { StatusBarItem } from "../StatusBarItem"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { StatusBarItem } from "../StatusBarItem"; +import type { VscodeApi } from "@cursorless/vscode-common"; export class KeyboardCommands { targeted: KeyboardCommandsTargeted; diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModal.ts b/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModal.ts index dd0124da0..6002aed4a 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModal.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModal.ts @@ -2,15 +2,15 @@ import { pick, sortedUniq, toPairs } from "lodash-es"; import { Grammar, Parser } from "nearley"; import * as vscode from "vscode"; import { KeyboardCommandsModalLayer } from "./KeyboardCommandsModalLayer"; -import KeyboardCommandsTargeted from "./KeyboardCommandsTargeted"; -import { KeyDescriptor } from "./TokenTypeHelpers"; -import { TokenTypeKeyMapMap } from "./TokenTypeHelpers"; -import KeyboardHandler from "./KeyboardHandler"; +import type KeyboardCommandsTargeted from "./KeyboardCommandsTargeted"; +import type { KeyDescriptor } from "./TokenTypeHelpers"; +import type { TokenTypeKeyMapMap } from "./TokenTypeHelpers"; +import type KeyboardHandler from "./KeyboardHandler"; import grammar from "./grammar/generated/grammar"; import { getAcceptableTokenTypes } from "./grammar/getAcceptableTokenTypes"; import { KeyboardCommandHandler } from "./KeyboardCommandHandler"; import { getTokenTypeKeyMaps } from "./getTokenTypeKeyMaps"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { VscodeApi } from "@cursorless/vscode-common"; import { KeyboardConfig } from "./KeyboardConfig"; import { CompositeKeyMap } from "@cursorless/common"; diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModalLayer.ts b/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModalLayer.ts index d68e41eab..1dc702f34 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModalLayer.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardCommandsModalLayer.ts @@ -1,7 +1,8 @@ import * as vscode from "vscode"; -import KeyboardHandler from "./KeyboardHandler"; -import TrieSearch from "trie-search"; -import { buildSuffixTrie, KeyValuePair } from "./buildSuffixTrie"; +import type KeyboardHandler from "./KeyboardHandler"; +import type TrieSearch from "trie-search"; +import type { KeyValuePair } from "./buildSuffixTrie"; +import { buildSuffixTrie } from "./buildSuffixTrie"; /** * Defines a single keyboard layer to use with a modal version of Cursorless diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardCommandsTargeted.ts b/packages/cursorless-vscode/src/keyboard/KeyboardCommandsTargeted.ts index 04b65c4df..bbc33833e 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardCommandsTargeted.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardCommandsTargeted.ts @@ -1,19 +1,19 @@ -import { +import type { ActionDescriptor, - LATEST_VERSION, Modifier, PartialMark, PartialPrimitiveTargetDescriptor, PartialTargetDescriptor, ScopeType, } from "@cursorless/common"; +import { LATEST_VERSION } from "@cursorless/common"; import { runCursorlessCommand } from "@cursorless/vscode-common"; import * as vscode from "vscode"; import type { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; import { getStyleName } from "../ide/vscode/hats/getStyleName"; -import KeyboardCommandsModal from "./KeyboardCommandsModal"; -import KeyboardHandler from "./KeyboardHandler"; -import { SimpleKeyboardActionDescriptor } from "./KeyboardActionType"; +import type KeyboardCommandsModal from "./KeyboardCommandsModal"; +import type KeyboardHandler from "./KeyboardHandler"; +import type { SimpleKeyboardActionDescriptor } from "./KeyboardActionType"; export type TargetingMode = | "replace" diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardConfig.ts b/packages/cursorless-vscode/src/keyboard/KeyboardConfig.ts index d915c7d20..6e5fba390 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardConfig.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardConfig.ts @@ -1,7 +1,7 @@ import { mapValues, pickBy } from "lodash-es"; -import { KeyMap, SectionName, TokenType } from "./TokenTypeHelpers"; -import { SectionTypes, TokenTypeValueMap } from "./TokenTypes"; -import { VscodeApi } from "@cursorless/vscode-common"; +import type { KeyMap, SectionName, TokenType } from "./TokenTypeHelpers"; +import type { SectionTypes, TokenTypeValueMap } from "./TokenTypes"; +import type { VscodeApi } from "@cursorless/vscode-common"; import { TextEditorCursorStyle } from "vscode"; const LEGACY_PLURAL_SECTION_NAMES: Record = { diff --git a/packages/cursorless-vscode/src/keyboard/KeyboardHandler.ts b/packages/cursorless-vscode/src/keyboard/KeyboardHandler.ts index 311ddabeb..37344d873 100644 --- a/packages/cursorless-vscode/src/keyboard/KeyboardHandler.ts +++ b/packages/cursorless-vscode/src/keyboard/KeyboardHandler.ts @@ -1,7 +1,7 @@ import { pull } from "lodash-es"; import * as vscode from "vscode"; -import { Disposable } from "vscode"; -import { StatusBarItem } from "../StatusBarItem"; +import type { Disposable } from "vscode"; +import type { StatusBarItem } from "../StatusBarItem"; /** * This when clause context is active if any Cursorless listener is in control diff --git a/packages/cursorless-vscode/src/keyboard/TokenTypeHelpers.ts b/packages/cursorless-vscode/src/keyboard/TokenTypeHelpers.ts index ac35d89ac..df7a8e02b 100644 --- a/packages/cursorless-vscode/src/keyboard/TokenTypeHelpers.ts +++ b/packages/cursorless-vscode/src/keyboard/TokenTypeHelpers.ts @@ -1,4 +1,4 @@ -import { SectionTypes, TokenTypeValueMap } from "./TokenTypes"; +import type { SectionTypes, TokenTypeValueMap } from "./TokenTypes"; export type SectionName = keyof SectionTypes; diff --git a/packages/cursorless-vscode/src/keyboard/TokenTypes.ts b/packages/cursorless-vscode/src/keyboard/TokenTypes.ts index f17c4434b..e6aedd618 100644 --- a/packages/cursorless-vscode/src/keyboard/TokenTypes.ts +++ b/packages/cursorless-vscode/src/keyboard/TokenTypes.ts @@ -1,6 +1,9 @@ -import { SimpleScopeTypeType, SurroundingPairName } from "@cursorless/common"; -import { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; -import { +import type { + SimpleScopeTypeType, + SurroundingPairName, +} from "@cursorless/common"; +import type { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; +import type { PolymorphicKeyboardActionDescriptor, SimpleKeyboardActionDescriptor, SpecificKeyboardActionDescriptor, diff --git a/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.test.ts b/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.test.ts index af17f4c39..df58f2dd5 100644 --- a/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.test.ts +++ b/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.test.ts @@ -1,5 +1,6 @@ import assert from "node:assert"; -import { KeyValuePair, buildSuffixTrie } from "./buildSuffixTrie"; +import type { KeyValuePair } from "./buildSuffixTrie"; +import { buildSuffixTrie } from "./buildSuffixTrie"; import { isEqual, sortBy, uniq, uniqWith } from "lodash-es"; interface TestCase { diff --git a/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.ts b/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.ts index e11ef7023..b6649367d 100644 --- a/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.ts +++ b/packages/cursorless-vscode/src/keyboard/buildSuffixTrie.ts @@ -1,5 +1,6 @@ import { isEqual, range, sortBy, uniqWith } from "lodash-es"; -import TrieSearch, { TrieSearchOptions } from "trie-search"; +import type { TrieSearchOptions } from "trie-search"; +import TrieSearch from "trie-search"; export interface KeyValuePair { key: string; diff --git a/packages/cursorless-vscode/src/keyboard/getTokenTypeKeyMaps.ts b/packages/cursorless-vscode/src/keyboard/getTokenTypeKeyMaps.ts index 78bc9665a..325def73b 100644 --- a/packages/cursorless-vscode/src/keyboard/getTokenTypeKeyMaps.ts +++ b/packages/cursorless-vscode/src/keyboard/getTokenTypeKeyMaps.ts @@ -1,12 +1,13 @@ import { isString, range } from "lodash-es"; -import { +import type { KeyboardActionType, PolymorphicKeyboardActionDescriptor, SpecificKeyboardActionDescriptor, - simpleKeyboardActionNames, } from "./KeyboardActionType"; -import { KeyboardConfig, only } from "./KeyboardConfig"; -import { TokenTypeKeyMapMap } from "./TokenTypeHelpers"; +import { simpleKeyboardActionNames } from "./KeyboardActionType"; +import type { KeyboardConfig } from "./KeyboardConfig"; +import { only } from "./KeyboardConfig"; +import type { TokenTypeKeyMapMap } from "./TokenTypeHelpers"; /** * Returns a map from token type names to a keymap for that token type. Something like: diff --git a/packages/cursorless-vscode/src/keyboard/grammar/CommandRulePostProcessor.ts b/packages/cursorless-vscode/src/keyboard/grammar/CommandRulePostProcessor.ts index 4e09bf242..3e0d2515e 100644 --- a/packages/cursorless-vscode/src/keyboard/grammar/CommandRulePostProcessor.ts +++ b/packages/cursorless-vscode/src/keyboard/grammar/CommandRulePostProcessor.ts @@ -1,4 +1,4 @@ -import { +import type { KeyboardCommand, KeyboardCommandArgTypes, } from "../KeyboardCommandTypeHelpers"; diff --git a/packages/cursorless-vscode/src/keyboard/grammar/command.ts b/packages/cursorless-vscode/src/keyboard/grammar/command.ts index 423fe938d..475f1e9b1 100644 --- a/packages/cursorless-vscode/src/keyboard/grammar/command.ts +++ b/packages/cursorless-vscode/src/keyboard/grammar/command.ts @@ -1,8 +1,7 @@ -import { KeyboardCommandArgTypes } from "../KeyboardCommandTypeHelpers"; -import { CommandRulePostProcessor } from "./CommandRulePostProcessor"; +import type { KeyboardCommandArgTypes } from "../KeyboardCommandTypeHelpers"; +import type { CommandRulePostProcessor } from "./CommandRulePostProcessor"; +import type { ArgExtractor, Unused } from "@cursorless/cursorless-engine"; import { - ArgExtractor, - Unused, getArgExtractors, constructPayload, } from "@cursorless/cursorless-engine"; diff --git a/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts b/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts index ebfc0591b..8e5a0f9d5 100644 --- a/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts +++ b/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts @@ -1,9 +1,9 @@ import assert from "assert"; import { Grammar, Parser } from "nearley"; -import { KeyDescriptor } from "../TokenTypeHelpers"; +import type { KeyDescriptor } from "../TokenTypeHelpers"; import grammar from "./generated/grammar"; +import type { AcceptableTokenType } from "./getAcceptableTokenTypes"; import { - AcceptableTokenType, MISSING, NEXT, getAcceptableTokenTypes, diff --git a/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts b/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts index c31752c90..d642e0e1a 100644 --- a/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts +++ b/packages/cursorless-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts @@ -1,9 +1,10 @@ -import nearley, { State } from "nearley"; +import type { State } from "nearley"; +import type nearley from "nearley"; import { isEqual, times } from "lodash-es"; -import { CommandRulePostProcessor } from "./CommandRulePostProcessor"; +import type { CommandRulePostProcessor } from "./CommandRulePostProcessor"; import { DefaultMap, uniqWithHash } from "@cursorless/common"; -import { KeyboardCommandHandler } from "../KeyboardCommandHandler"; -import { TokenType } from "../TokenTypeHelpers"; +import type { KeyboardCommandHandler } from "../KeyboardCommandHandler"; +import type { TokenType } from "../TokenTypeHelpers"; export interface AcceptableTokenType { /** diff --git a/packages/cursorless-vscode/src/keyboard/grammar/grammar.test.ts b/packages/cursorless-vscode/src/keyboard/grammar/grammar.test.ts index 04e612e5f..ef105a0b2 100644 --- a/packages/cursorless-vscode/src/keyboard/grammar/grammar.test.ts +++ b/packages/cursorless-vscode/src/keyboard/grammar/grammar.test.ts @@ -1,9 +1,9 @@ import { Parser, Grammar } from "nearley"; import grammar from "./generated/grammar"; import assert from "assert"; -import { KeyDescriptor } from "../TokenTypeHelpers"; -import { KeyboardCommandHandler } from "../KeyboardCommandHandler"; -import { KeyboardCommand } from "../KeyboardCommandTypeHelpers"; +import type { KeyDescriptor } from "../TokenTypeHelpers"; +import type { KeyboardCommandHandler } from "../KeyboardCommandHandler"; +import type { KeyboardCommand } from "../KeyboardCommandTypeHelpers"; import { stringifyTokens } from "./stringifyTokens"; interface TestCase { diff --git a/packages/cursorless-vscode/src/keyboard/grammar/keyboardLexer.ts b/packages/cursorless-vscode/src/keyboard/grammar/keyboardLexer.ts index c1b7713db..6afef2c2b 100644 --- a/packages/cursorless-vscode/src/keyboard/grammar/keyboardLexer.ts +++ b/packages/cursorless-vscode/src/keyboard/grammar/keyboardLexer.ts @@ -1,5 +1,5 @@ -import { Lexer } from "nearley"; -import { TokenTypeKeyMapMap } from "../TokenTypeHelpers"; +import type { Lexer } from "nearley"; +import type { TokenTypeKeyMapMap } from "../TokenTypeHelpers"; interface LexerState { index: number; diff --git a/packages/cursorless-vscode/src/logQuickActions.ts b/packages/cursorless-vscode/src/logQuickActions.ts index 3cb4842d0..e5d3c6b81 100644 --- a/packages/cursorless-vscode/src/logQuickActions.ts +++ b/packages/cursorless-vscode/src/logQuickActions.ts @@ -1,4 +1,5 @@ -import { CodeAction, commands, window } from "vscode"; +import type { CodeAction } from "vscode"; +import { commands, window } from "vscode"; /** * Displays quick actions at the current cursor position in the active text diff --git a/packages/cursorless-vscode/src/registerCommands.ts b/packages/cursorless-vscode/src/registerCommands.ts index 51dc476ee..fbaefeea8 100644 --- a/packages/cursorless-vscode/src/registerCommands.ts +++ b/packages/cursorless-vscode/src/registerCommands.ts @@ -1,28 +1,28 @@ +import type { CursorlessCommandId } from "@cursorless/common"; import { CURSORLESS_COMMAND_ID, - CursorlessCommandId, type CommandHistoryStorage, } from "@cursorless/common"; import { showCheatsheet, updateDefaults, } from "@cursorless/cursorless-cheatsheet"; -import { +import type { CommandApi, StoredTargetMap, - analyzeCommandHistory, } from "@cursorless/cursorless-engine"; +import { analyzeCommandHistory } from "@cursorless/cursorless-engine"; import type { ScopeTestRecorder, TestCaseRecorder, } from "@cursorless/test-case-recorder"; import * as vscode from "vscode"; -import { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; -import { VscodeTutorial } from "./VscodeTutorial"; +import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; +import type { VscodeTutorial } from "./VscodeTutorial"; import { showDocumentation, showQuickPick } from "./commands"; -import { VscodeIDE } from "./ide/vscode/VscodeIDE"; -import { VscodeHats } from "./ide/vscode/hats/VscodeHats"; -import { KeyboardCommands } from "./keyboard/KeyboardCommands"; +import type { VscodeIDE } from "./ide/vscode/VscodeIDE"; +import type { VscodeHats } from "./ide/vscode/hats/VscodeHats"; +import type { KeyboardCommands } from "./keyboard/KeyboardCommands"; import { logQuickActions } from "./logQuickActions"; export function registerCommands( diff --git a/packages/cursorless-vscode/src/revisualizeOnCustomRegexChange.ts b/packages/cursorless-vscode/src/revisualizeOnCustomRegexChange.ts index c6a1879fd..bf1fc6588 100644 --- a/packages/cursorless-vscode/src/revisualizeOnCustomRegexChange.ts +++ b/packages/cursorless-vscode/src/revisualizeOnCustomRegexChange.ts @@ -1,11 +1,11 @@ -import { +import type { Disposable, ScopeProvider, ScopeTypeInfo, - disposableFrom, } from "@cursorless/common"; +import { disposableFrom } from "@cursorless/common"; import { isEqual } from "lodash-es"; -import { +import type { ScopeVisualizer, VisualizationType, } from "./ScopeVisualizerCommandApi"; diff --git a/packages/cursorless-vscode/src/scripts/hatAdjustments/add.ts b/packages/cursorless-vscode/src/scripts/hatAdjustments/add.ts index eb54b4af1..ac32fcc44 100644 --- a/packages/cursorless-vscode/src/scripts/hatAdjustments/add.ts +++ b/packages/cursorless-vscode/src/scripts/hatAdjustments/add.ts @@ -2,11 +2,11 @@ * This script can be used to add hat tweaks to the currently shipping ones */ import { sum } from "lodash-es"; -import { - defaultShapeAdjustments, +import type { HatAdjustments, IndividualHatAdjustmentMap, } from "../../ide/vscode/hats/shapeAdjustments"; +import { defaultShapeAdjustments } from "../../ide/vscode/hats/shapeAdjustments"; import { HAT_SHAPES } from "../../ide/vscode/hatStyles.types"; import { postProcessValue } from "./lib"; diff --git a/packages/cursorless-vscode/src/scripts/hatAdjustments/average.ts b/packages/cursorless-vscode/src/scripts/hatAdjustments/average.ts index 8159d1506..e58452c2a 100644 --- a/packages/cursorless-vscode/src/scripts/hatAdjustments/average.ts +++ b/packages/cursorless-vscode/src/scripts/hatAdjustments/average.ts @@ -1,11 +1,11 @@ /** * This script can be used to add hat tweaks to the currently shipping ones */ -import { - defaultShapeAdjustments, +import type { HatAdjustments, IndividualHatAdjustmentMap, } from "../../ide/vscode/hats/shapeAdjustments"; +import { defaultShapeAdjustments } from "../../ide/vscode/hats/shapeAdjustments"; import { HAT_SHAPES } from "../../ide/vscode/hatStyles.types"; import { postProcessValue } from "./lib"; diff --git a/packages/cursorless-vscode/src/scripts/populateDist/Asset.ts b/packages/cursorless-vscode/src/scripts/populateDist/Asset.ts index 5052f74de..32fc04241 100644 --- a/packages/cursorless-vscode/src/scripts/populateDist/Asset.ts +++ b/packages/cursorless-vscode/src/scripts/populateDist/Asset.ts @@ -1,4 +1,4 @@ -import { Context } from "./context"; +import type { Context } from "./context"; export interface Asset { source?: string; diff --git a/packages/cursorless-vscode/src/scripts/populateDist/assets.ts b/packages/cursorless-vscode/src/scripts/populateDist/assets.ts index 20bb8ea20..69ae42343 100644 --- a/packages/cursorless-vscode/src/scripts/populateDist/assets.ts +++ b/packages/cursorless-vscode/src/scripts/populateDist/assets.ts @@ -1,6 +1,6 @@ import { transformPackageJson } from "./transformPackageJson"; import { generateBuildInfo } from "./generateBuildInfo"; -import { Asset } from "./Asset"; +import type { Asset } from "./Asset"; export const assets: Asset[] = [ { source: "../../CHANGELOG.md", destination: "CHANGELOG.md" }, diff --git a/packages/cursorless-vscode/src/scripts/populateDist/generateBuildInfo.ts b/packages/cursorless-vscode/src/scripts/populateDist/generateBuildInfo.ts index 7e933d798..d51250155 100644 --- a/packages/cursorless-vscode/src/scripts/populateDist/generateBuildInfo.ts +++ b/packages/cursorless-vscode/src/scripts/populateDist/generateBuildInfo.ts @@ -1,6 +1,6 @@ import { getEnvironmentVariableStrict } from "@cursorless/common"; import { runCommand } from "./runCommand"; -import { Context } from "./context"; +import type { Context } from "./context"; export async function generateBuildInfo({ isCi }: Context) { // In CI, we generate a file called `build-info.json` that contains diff --git a/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts b/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts index 00569c088..a6ded50c7 100644 --- a/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts +++ b/packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts @@ -3,7 +3,7 @@ import { copy, exists } from "fs-extra"; import { lstat, mkdir, readFile, rm, writeFile } from "node:fs/promises"; import * as path from "node:path"; import { assets } from "./assets"; -import { Context } from "./context"; +import type { Context } from "./context"; // Iterate over assets, copying each file to the destination. Any parent // directories will be created as necessary, and source directories will be diff --git a/packages/cursorless-vscode/src/scripts/populateDist/transformPackageJson.ts b/packages/cursorless-vscode/src/scripts/populateDist/transformPackageJson.ts index d33c31dbd..39f751ad0 100644 --- a/packages/cursorless-vscode/src/scripts/populateDist/transformPackageJson.ts +++ b/packages/cursorless-vscode/src/scripts/populateDist/transformPackageJson.ts @@ -1,5 +1,5 @@ import * as semver from "semver"; -import { Context } from "./context"; +import type { Context } from "./context"; import { runCommand } from "./runCommand"; export async function transformPackageJson( diff --git a/packages/cursorless-vscode/src/storedTargetHighlighter.ts b/packages/cursorless-vscode/src/storedTargetHighlighter.ts index 4df03e63b..cb2e327e8 100644 --- a/packages/cursorless-vscode/src/storedTargetHighlighter.ts +++ b/packages/cursorless-vscode/src/storedTargetHighlighter.ts @@ -1,10 +1,11 @@ -import { StoredTargetKey, groupBy, toCharacterRange } from "@cursorless/common"; -import { StoredTargetMap } from "@cursorless/cursorless-engine"; -import { +import type { StoredTargetKey } from "@cursorless/common"; +import { groupBy, toCharacterRange } from "@cursorless/common"; +import type { StoredTargetMap } from "@cursorless/cursorless-engine"; +import type { ScopeRangeType, ScopeVisualizerColorConfig, } from "@cursorless/vscode-common"; -import { VscodeIDE } from "./ide/vscode/VscodeIDE"; +import type { VscodeIDE } from "./ide/vscode/VscodeIDE"; import { VscodeFancyRangeHighlighter } from "./ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter"; import { getColorsFromConfig } from "./ide/vscode/VSCodeScopeVisualizer/getColorsFromConfig"; import { mapValues } from "lodash-es"; diff --git a/packages/cursorless-vscode/src/usingSetting.ts b/packages/cursorless-vscode/src/usingSetting.ts index 64045bfee..6816c3216 100644 --- a/packages/cursorless-vscode/src/usingSetting.ts +++ b/packages/cursorless-vscode/src/usingSetting.ts @@ -1,5 +1,5 @@ import { vscodeApi } from "./vscodeApi"; -import { Disposable } from "@cursorless/common"; +import type { Disposable } from "@cursorless/common"; /** * Watches for changes to a setting and calls a factory function whenever the diff --git a/packages/cursorless-vscode/src/vscodeApi.ts b/packages/cursorless-vscode/src/vscodeApi.ts index 72c9a1de1..96a8abfbe 100644 --- a/packages/cursorless-vscode/src/vscodeApi.ts +++ b/packages/cursorless-vscode/src/vscodeApi.ts @@ -1,4 +1,4 @@ -import { VscodeApi } from "@cursorless/vscode-common"; +import type { VscodeApi } from "@cursorless/vscode-common"; import { commands, env, window, workspace } from "vscode"; /** diff --git a/packages/meta-updater/src/Context.ts b/packages/meta-updater/src/Context.ts index 8a0196cc5..3d45d804a 100644 --- a/packages/meta-updater/src/Context.ts +++ b/packages/meta-updater/src/Context.ts @@ -1,4 +1,4 @@ -import { Lockfile } from "@pnpm/lockfile-file"; +import type { Lockfile } from "@pnpm/lockfile-file"; /** Contains context to be used by all updaters */ export interface Context { diff --git a/packages/meta-updater/src/getCursorlessVscodeFields.ts b/packages/meta-updater/src/getCursorlessVscodeFields.ts index 4407991a4..fd707bac6 100644 --- a/packages/meta-updater/src/getCursorlessVscodeFields.ts +++ b/packages/meta-updater/src/getCursorlessVscodeFields.ts @@ -1,5 +1,5 @@ import { cursorlessCommandDescriptions } from "@cursorless/common"; -import { PackageJson } from "type-fest"; +import type { PackageJson } from "type-fest"; export function getCursorlessVscodeFields(input: PackageJson) { return { diff --git a/packages/meta-updater/src/metaUpdater.ts b/packages/meta-updater/src/metaUpdater.ts index b82d66e32..4aaccd4d3 100644 --- a/packages/meta-updater/src/metaUpdater.ts +++ b/packages/meta-updater/src/metaUpdater.ts @@ -5,7 +5,7 @@ import { languageScopeSupport } from "@cursorless/common"; import { readWantedLockfile } from "@pnpm/lockfile-file"; import { createUpdateOptions } from "@pnpm/meta-updater"; -import { Context } from "./Context"; +import type { Context } from "./Context"; import { textFormat } from "./textFormat"; import { updateLanguageMdxConfig } from "./updateLanguageScopeSupportConfig"; import { updatePackageJson } from "./updatePackageJson"; diff --git a/packages/meta-updater/src/updatePackageJson.ts b/packages/meta-updater/src/updatePackageJson.ts index 54db28b6f..784fa25cb 100644 --- a/packages/meta-updater/src/updatePackageJson.ts +++ b/packages/meta-updater/src/updatePackageJson.ts @@ -4,8 +4,8 @@ import { readFile } from "fs/promises"; import * as yaml from "js-yaml"; import { isUndefined } from "lodash-es"; import { join } from "path"; -import { PackageJson } from "type-fest"; -import { Context } from "./Context"; +import type { PackageJson } from "type-fest"; +import type { Context } from "./Context"; import { getCursorlessVscodeFields } from "./getCursorlessVscodeFields"; const LIB_ENTRY_POINT = "./src/index.ts"; diff --git a/packages/meta-updater/src/updateTSConfig.ts b/packages/meta-updater/src/updateTSConfig.ts index 36c07f5f7..bdac32ac5 100644 --- a/packages/meta-updater/src/updateTSConfig.ts +++ b/packages/meta-updater/src/updateTSConfig.ts @@ -2,9 +2,9 @@ import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import normalizePath from "normalize-path"; import * as path from "path"; import { pathExists } from "path-exists"; -import { PackageJson, TsConfigJson } from "type-fest"; +import type { PackageJson, TsConfigJson } from "type-fest"; import { toPosixPath } from "./toPosixPath"; -import { Context } from "./Context"; +import type { Context } from "./Context"; import { cloneDeep, isEqual, uniq } from "lodash-es"; import { readFile } from "fs/promises"; diff --git a/packages/neovim-common/src/TestHelpers.ts b/packages/neovim-common/src/TestHelpers.ts index 1a789cd3c..1ecd686a2 100644 --- a/packages/neovim-common/src/TestHelpers.ts +++ b/packages/neovim-common/src/TestHelpers.ts @@ -4,7 +4,7 @@ import type { ScopeProvider, TestHelpers, } from "@cursorless/common"; -import { NeovimIDE } from "./ide/neovim/NeovimIDE"; +import type { NeovimIDE } from "./ide/neovim/NeovimIDE"; export interface NeovimTestHelpers extends TestHelpers { ide: NormalizedIDE; diff --git a/packages/neovim-common/src/getExtensionApi.ts b/packages/neovim-common/src/getExtensionApi.ts index 12ca15a22..f05f825df 100644 --- a/packages/neovim-common/src/getExtensionApi.ts +++ b/packages/neovim-common/src/getExtensionApi.ts @@ -1,7 +1,7 @@ import type { SnippetMap } from "@cursorless/common"; //import * as vscode from "vscode"; import { getNeovimRegistry } from "@cursorless/neovim-registry"; -import { NeovimTestHelpers } from "./TestHelpers"; +import type { NeovimTestHelpers } from "./TestHelpers"; export interface CursorlessApi { testHelpers: NeovimTestHelpers | undefined; diff --git a/packages/neovim-common/src/ide/neovim/NeovimCapabilities.ts b/packages/neovim-common/src/ide/neovim/NeovimCapabilities.ts index 1d5a21d29..f7e2e58e1 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimCapabilities.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimCapabilities.ts @@ -1,4 +1,4 @@ -import { Capabilities, CommandCapabilityMap } from "@cursorless/common"; +import type { Capabilities, CommandCapabilityMap } from "@cursorless/common"; const COMMAND_CAPABILITIES: CommandCapabilityMap = { clipboardCopy: { acceptsLocation: false }, diff --git a/packages/neovim-common/src/ide/neovim/NeovimConfiguration.ts b/packages/neovim-common/src/ide/neovim/NeovimConfiguration.ts index bd8bf7e24..933ae038b 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimConfiguration.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimConfiguration.ts @@ -1,13 +1,13 @@ import { get } from "lodash"; import { Notifier } from "@cursorless/common"; -import { +import type { Configuration, ConfigurationScope, - CONFIGURATION_DEFAULTS, CursorlessConfigKey, CursorlessConfiguration, } from "@cursorless/common"; -import { GetFieldType, Paths } from "@cursorless/common"; +import { CONFIGURATION_DEFAULTS } from "@cursorless/common"; +import type { GetFieldType, Paths } from "@cursorless/common"; interface ConfigurationScopeValues { scope: ConfigurationScope; diff --git a/packages/neovim-common/src/ide/neovim/NeovimEdit.ts b/packages/neovim-common/src/ide/neovim/NeovimEdit.ts index 208c2e544..a9fcc90af 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimEdit.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimEdit.ts @@ -1,4 +1,4 @@ -import { +import type { Edit, Position, Range, @@ -6,7 +6,7 @@ import { TextDocumentContentChangeEvent, } from "@cursorless/common"; import type { NeovimClient, Window } from "neovim"; -import { NeovimIDE } from "./NeovimIDE"; +import type { NeovimIDE } from "./NeovimIDE"; import { getNeovimRegistry } from "@cursorless/neovim-registry"; export default async function neovimEdit( diff --git a/packages/neovim-common/src/ide/neovim/NeovimEvents.ts b/packages/neovim-common/src/ide/neovim/NeovimEvents.ts index ed42b8d21..baa07ba01 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimEvents.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimEvents.ts @@ -1,11 +1,10 @@ -import { +import type { Disposable, - Position, - Range, TextDocument, TextDocumentChangeEvent, TextDocumentContentChangeEvent, } from "@cursorless/common"; +import { Position, Range } from "@cursorless/common"; import { getNeovimRegistry } from "@cursorless/neovim-registry"; import type { Buffer } from "neovim"; diff --git a/packages/neovim-common/src/ide/neovim/NeovimIDE.ts b/packages/neovim-common/src/ide/neovim/NeovimIDE.ts index 5e9777f27..6d7798707 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimIDE.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimIDE.ts @@ -10,7 +10,7 @@ import type { TextEditor, WorkspaceFolder, } from "@cursorless/common"; -import { +import type { Event, FlashDescriptor, GeneralizedRange, diff --git a/packages/neovim-common/src/ide/neovim/NeovimTextDocumentImpl.ts b/packages/neovim-common/src/ide/neovim/NeovimTextDocumentImpl.ts index 454e9c3a7..a0b1525c3 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimTextDocumentImpl.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimTextDocumentImpl.ts @@ -1,11 +1,6 @@ -import { - EndOfLine, - Position, - Range, - TextDocument, - TextLine, -} from "@cursorless/common"; -import { URI } from "vscode-uri"; +import type { EndOfLine, TextDocument, TextLine } from "@cursorless/common"; +import { Position, Range } from "@cursorless/common"; +import type { URI } from "vscode-uri"; import NeovimTextLineImpl from "./NeovimTextLineImpl"; import path from "node:path"; diff --git a/packages/neovim-common/src/ide/neovim/NeovimTextEditorImpl.ts b/packages/neovim-common/src/ide/neovim/NeovimTextEditorImpl.ts index e0ca5848b..c776cb535 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimTextEditorImpl.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimTextEditorImpl.ts @@ -1,4 +1,4 @@ -import { +import type { BreakpointDescriptor, Edit, EditableTextEditor, @@ -13,8 +13,8 @@ import type { NeovimClient, Window } from "neovim"; import { bufferSetSelections } from "../../neovimApi"; import { neovimClipboardCopy, neovimClipboardPaste } from "../../neovimHelpers"; import neovimEdit from "./NeovimEdit"; -import { NeovimIDE } from "./NeovimIDE"; -import { NeovimTextDocumentImpl } from "./NeovimTextDocumentImpl"; +import type { NeovimIDE } from "./NeovimIDE"; +import type { NeovimTextDocumentImpl } from "./NeovimTextDocumentImpl"; export class NeovimTextEditorImpl implements EditableTextEditor { private _document: NeovimTextDocumentImpl; diff --git a/packages/neovim-common/src/ide/neovim/NeovimTextLineImpl.ts b/packages/neovim-common/src/ide/neovim/NeovimTextLineImpl.ts index 1ffea9121..61bcf4310 100644 --- a/packages/neovim-common/src/ide/neovim/NeovimTextLineImpl.ts +++ b/packages/neovim-common/src/ide/neovim/NeovimTextLineImpl.ts @@ -1,4 +1,5 @@ -import { Range, TextLine } from "@cursorless/common"; +import type { TextLine } from "@cursorless/common"; +import { Range } from "@cursorless/common"; export default class NeovimTextLineImpl implements TextLine { private readonly _lineNumber: number; diff --git a/packages/neovim-common/src/neovimHelpers.ts b/packages/neovim-common/src/neovimHelpers.ts index ca9d23ca6..517c61920 100644 --- a/packages/neovim-common/src/neovimHelpers.ts +++ b/packages/neovim-common/src/neovimHelpers.ts @@ -5,9 +5,9 @@ import { pasteFromClipboard, setClipboard, } from "@cursorless/neovim-common"; -import { NeovimTextEditorImpl } from "./ide/neovim/NeovimTextEditorImpl"; +import type { NeovimTextEditorImpl } from "./ide/neovim/NeovimTextEditorImpl"; import type { NeovimClient } from "neovim"; -import { IDE } from "@cursorless/common"; +import type { IDE } from "@cursorless/common"; export async function neovimClipboardCopy( client: NeovimClient, diff --git a/packages/neovim-common/src/runCommand.ts b/packages/neovim-common/src/runCommand.ts index c25146c2e..03a78a42f 100644 --- a/packages/neovim-common/src/runCommand.ts +++ b/packages/neovim-common/src/runCommand.ts @@ -1,8 +1,5 @@ -import { - Command, - CommandResponse, - CURSORLESS_COMMAND_ID, -} from "@cursorless/common"; +import type { Command, CommandResponse } from "@cursorless/common"; +import { CURSORLESS_COMMAND_ID } from "@cursorless/common"; import { getNeovimRegistry } from "@cursorless/neovim-registry"; export async function runCursorlessCommand( diff --git a/packages/neovim-common/src/testUtil/openNewEditor.ts b/packages/neovim-common/src/testUtil/openNewEditor.ts index 5f2b5da61..8c428e731 100644 --- a/packages/neovim-common/src/testUtil/openNewEditor.ts +++ b/packages/neovim-common/src/testUtil/openNewEditor.ts @@ -1,5 +1,5 @@ -import { NeovimTextEditorImpl } from ".."; -import { NeovimTextDocumentImpl } from "../ide/neovim/NeovimTextDocumentImpl"; +import type { NeovimTextEditorImpl } from ".."; +import type { NeovimTextDocumentImpl } from "../ide/neovim/NeovimTextDocumentImpl"; export interface NewEditorOptions { languageId?: string; diff --git a/packages/node-common/src/FileSystemTalonSpokenForms.ts b/packages/node-common/src/FileSystemTalonSpokenForms.ts index 5bc8a303d..97585cc05 100644 --- a/packages/node-common/src/FileSystemTalonSpokenForms.ts +++ b/packages/node-common/src/FileSystemTalonSpokenForms.ts @@ -1,10 +1,12 @@ -import { +import type { Disposable, FileSystem, - NeedsInitialTalonUpdateError, - Notifier, SpokenFormEntry, TalonSpokenForms, +} from "@cursorless/common"; +import { + NeedsInitialTalonUpdateError, + Notifier, type Listener, } from "@cursorless/common"; import { readFile } from "node:fs/promises"; diff --git a/packages/node-common/src/FileSystemTutorialContentProvider.ts b/packages/node-common/src/FileSystemTutorialContentProvider.ts index d24d1842e..047ec600d 100644 --- a/packages/node-common/src/FileSystemTutorialContentProvider.ts +++ b/packages/node-common/src/FileSystemTutorialContentProvider.ts @@ -1,4 +1,4 @@ -import { +import type { RawTutorialContent, TutorialContentProvider, TutorialId, diff --git a/packages/node-common/src/loadFixture.ts b/packages/node-common/src/loadFixture.ts index 877050a1b..6f9af8adc 100644 --- a/packages/node-common/src/loadFixture.ts +++ b/packages/node-common/src/loadFixture.ts @@ -1,6 +1,6 @@ import * as yaml from "js-yaml"; import { readFile } from "node:fs/promises"; -import { TestCaseFixtureLegacy } from "@cursorless/common"; +import type { TestCaseFixtureLegacy } from "@cursorless/common"; export async function loadFixture( path: string, diff --git a/packages/node-common/src/runRecordedTest.ts b/packages/node-common/src/runRecordedTest.ts index f411c22b2..78b2a8cdb 100644 --- a/packages/node-common/src/runRecordedTest.ts +++ b/packages/node-common/src/runRecordedTest.ts @@ -1,16 +1,18 @@ -import { +import type { Command, CommandResponse, Fallback, - Position, PositionPlainObject, ReadOnlyHatMap, - Selection, SelectionPlainObject, SerializedMarks, SpyIDE, TestCaseFixtureLegacy, TextEditor, +} from "@cursorless/common"; +import { + Position, + Selection, clientSupportsFallback, getSnapshotForComparison, omitByDeep, diff --git a/packages/test-case-recorder/src/RecordTestCaseCommandOptions.ts b/packages/test-case-recorder/src/RecordTestCaseCommandOptions.ts index 69efb0f37..f93079fae 100644 --- a/packages/test-case-recorder/src/RecordTestCaseCommandOptions.ts +++ b/packages/test-case-recorder/src/RecordTestCaseCommandOptions.ts @@ -1,4 +1,4 @@ -import { ExtraSnapshotField } from "@cursorless/common"; +import type { ExtraSnapshotField } from "@cursorless/common"; /** * This is the type of the `recordTestCase` command's argument. It is used to diff --git a/packages/test-case-recorder/src/TestCase.ts b/packages/test-case-recorder/src/TestCase.ts index b97901b6e..e88171e67 100644 --- a/packages/test-case-recorder/src/TestCase.ts +++ b/packages/test-case-recorder/src/TestCase.ts @@ -1,24 +1,26 @@ -import { +import type { ActionType, CommandLatest, CommandResponse, EnforceUndefined, - extractTargetedMarks, ExtraSnapshotField, Fallback, FocusedElementType, - marksToPlainObject, PartialTargetDescriptor, PlainSpyIDERecordedValues, ReadOnlyHatMap, SerializedMarks, - serializeTestFixture, SpyIDE, - spyIDERecordedValuesToPlainObject, TestCaseFixture, TestCaseSnapshot, ThrownError, Token, +} from "@cursorless/common"; +import { + extractTargetedMarks, + marksToPlainObject, + serializeTestFixture, + spyIDERecordedValuesToPlainObject, unsafeKeys, } from "@cursorless/common"; import { diff --git a/packages/test-case-recorder/src/TestCaseRecorder.ts b/packages/test-case-recorder/src/TestCaseRecorder.ts index 9898f3431..b340a2635 100644 --- a/packages/test-case-recorder/src/TestCaseRecorder.ts +++ b/packages/test-case-recorder/src/TestCaseRecorder.ts @@ -1,33 +1,37 @@ -import { +import type { CommandComplete, CommandLatest, CommandResponse, CommandServerApi, DecoratedSymbolMark, - DEFAULT_TEXT_EDITOR_OPTIONS_FOR_TEST, - extractTargetedMarks, ExtraSnapshotField, - getKey, HatTokenMap, IDE, - marksToPlainObject, ReadOnlyHatMap, - serialize, SerializedMarks, + TextEditorOptions, +} from "@cursorless/common"; +import { + DEFAULT_TEXT_EDITOR_OPTIONS_FOR_TEST, + extractTargetedMarks, + getKey, + marksToPlainObject, + serialize, showError, showInfo, sleep, SpyIDE, - TextEditorOptions, toLineRange, } from "@cursorless/common"; -import { +import type { CommandRunner, + StoredTargetMap, +} from "@cursorless/cursorless-engine"; +import { defaultSpokenFormMap, ide, injectIde, SpokenFormGenerator, - StoredTargetMap, } from "@cursorless/cursorless-engine"; import { getRecordedTestsDirPath, walkDirsSync } from "@cursorless/node-common"; import { invariant } from "immutability-helper"; @@ -35,7 +39,7 @@ import { merge } from "lodash-es"; import * as fs from "node:fs"; import { access, readFile, unlink } from "node:fs/promises"; import * as path from "node:path"; -import { RecordTestCaseCommandOptions } from "./RecordTestCaseCommandOptions"; +import type { RecordTestCaseCommandOptions } from "./RecordTestCaseCommandOptions"; import { takeSnapshot } from "./takeSnapshot"; import { TestCase } from "./TestCase"; diff --git a/packages/test-case-recorder/src/takeSnapshot.ts b/packages/test-case-recorder/src/takeSnapshot.ts index 5e3e3ace9..571db9956 100644 --- a/packages/test-case-recorder/src/takeSnapshot.ts +++ b/packages/test-case-recorder/src/takeSnapshot.ts @@ -1,15 +1,17 @@ -import { +import type { ExcludableSnapshotField, ExtraContext, ExtraSnapshotField, IDE, - rangeToPlainObject, - selectionToPlainObject, SerializedMarks, - storedTargetKeys, TestCaseSnapshot, TextEditor, } from "@cursorless/common"; +import { + rangeToPlainObject, + selectionToPlainObject, + storedTargetKeys, +} from "@cursorless/common"; import type { StoredTargetMap } from "@cursorless/cursorless-engine"; import { hrtimeBigintToSeconds } from "./timeUtils"; diff --git a/packages/vscode-common/src/TestHelpers.ts b/packages/vscode-common/src/TestHelpers.ts index ed6ee91f2..7fc9ff959 100644 --- a/packages/vscode-common/src/TestHelpers.ts +++ b/packages/vscode-common/src/TestHelpers.ts @@ -5,9 +5,9 @@ import type { TestHelpers, TextEditor, } from "@cursorless/common"; -import * as vscode from "vscode"; -import { VscodeApi } from "./VscodeApi"; -import { SpyWebViewEvent } from "./SpyWebViewEvent"; +import type * as vscode from "vscode"; +import type { VscodeApi } from "./VscodeApi"; +import type { SpyWebViewEvent } from "./SpyWebViewEvent"; export interface VscodeTestHelpers extends TestHelpers { ide: NormalizedIDE; diff --git a/packages/vscode-common/src/VscodeApi.ts b/packages/vscode-common/src/VscodeApi.ts index 5e63bd596..ceb2bf55f 100644 --- a/packages/vscode-common/src/VscodeApi.ts +++ b/packages/vscode-common/src/VscodeApi.ts @@ -1,4 +1,4 @@ -import { workspace, window, TextEditor, env, commands } from "vscode"; +import type { workspace, window, TextEditor, env, commands } from "vscode"; /** * Subset of VSCode api that we need to be able to mock for testing diff --git a/packages/vscode-common/src/getExtensionApi.ts b/packages/vscode-common/src/getExtensionApi.ts index 182bd2f82..a8cf87f21 100644 --- a/packages/vscode-common/src/getExtensionApi.ts +++ b/packages/vscode-common/src/getExtensionApi.ts @@ -1,7 +1,7 @@ import type { CommandServerApi, SnippetMap } from "@cursorless/common"; import * as vscode from "vscode"; import type { Language, SyntaxNode, Tree } from "web-tree-sitter"; -import { VscodeTestHelpers } from "./TestHelpers"; +import type { VscodeTestHelpers } from "./TestHelpers"; export interface CursorlessApi { testHelpers: VscodeTestHelpers | undefined; diff --git a/packages/vscode-common/src/runCommand.ts b/packages/vscode-common/src/runCommand.ts index 19e156d49..fd2c986e1 100644 --- a/packages/vscode-common/src/runCommand.ts +++ b/packages/vscode-common/src/runCommand.ts @@ -1,8 +1,5 @@ -import { - Command, - CommandResponse, - CURSORLESS_COMMAND_ID, -} from "@cursorless/common"; +import type { Command, CommandResponse } from "@cursorless/common"; +import { CURSORLESS_COMMAND_ID } from "@cursorless/common"; import * as vscode from "vscode"; export async function runCursorlessCommand( diff --git a/packages/vscode-common/src/vscodeUtil.ts b/packages/vscode-common/src/vscodeUtil.ts index 6ab9f4d4f..6152097f6 100644 --- a/packages/vscode-common/src/vscodeUtil.ts +++ b/packages/vscode-common/src/vscodeUtil.ts @@ -1,4 +1,5 @@ -import { EndOfLine, Position, Range, Selection } from "@cursorless/common"; +import type { EndOfLine } from "@cursorless/common"; +import { Position, Range, Selection } from "@cursorless/common"; import * as vscode from "vscode"; export function toVscodeRange(range: Range): vscode.Range {