diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 57502f0c26..bbd31e5d1d 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -1,6 +1,12 @@ { "$schema": "./node_modules/oxfmt/configuration_schema.json", "sortPackageJson": false, + "sortImports": { + "newlinesBetween": false, + "partitionByNewline": true, + "internalPattern": ["@cursorless/"] + }, + "ignorePatterns": [ "/packages/app-vscode/src/keyboard/grammar/generated/", "/packages/lib-engine/src/customCommandGrammar/generated/", diff --git a/packages/app-neovim/src/NeovimCommandServerApi.ts b/packages/app-neovim/src/NeovimCommandServerApi.ts index af23ed18dc..a0d09de8f8 100644 --- a/packages/app-neovim/src/NeovimCommandServerApi.ts +++ b/packages/app-neovim/src/NeovimCommandServerApi.ts @@ -1,9 +1,9 @@ +import type { NeovimClient } from "neovim/lib/api/client"; import type { CommandServerApi, FocusedElementType, InboundSignal, } from "@cursorless/lib-common"; -import type { NeovimClient } from "neovim/lib/api/client"; export class NeovimCommandServerApi implements CommandServerApi { signals: { prePhrase: InboundSignal }; diff --git a/packages/app-neovim/src/extension.ts b/packages/app-neovim/src/extension.ts index b667e0581f..c8777da032 100644 --- a/packages/app-neovim/src/extension.ts +++ b/packages/app-neovim/src/extension.ts @@ -1,3 +1,5 @@ +import type { NeovimClient } from "neovim/lib/api/client"; +import type { NvimPlugin } from "neovim/lib/host/NvimPlugin"; import { FakeCommandServerApi, FakeIDE, @@ -6,10 +8,8 @@ import { import { createCursorlessEngine } from "@cursorless/lib-engine"; import { EXTENSION_ID, NeovimIDE } from "@cursorless/lib-neovim-common"; import { getNeovimRegistry } from "@cursorless/lib-neovim-registry"; -import type { NeovimClient } from "neovim/lib/api/client"; -import type { NvimPlugin } from "neovim/lib/host/NvimPlugin"; -import { NeovimCommandServerApi } from "./NeovimCommandServerApi"; import { constructTestHelpers } from "./constructTestHelpers"; +import { NeovimCommandServerApi } from "./NeovimCommandServerApi"; import { registerCommands } from "./registerCommands"; /** diff --git a/packages/app-neovim/src/registerCommands.ts b/packages/app-neovim/src/registerCommands.ts index 419c9bf7ae..f3055c684b 100644 --- a/packages/app-neovim/src/registerCommands.ts +++ b/packages/app-neovim/src/registerCommands.ts @@ -1,3 +1,4 @@ +import type { NeovimClient } from "neovim"; import type { CommandResponse, CommandServerApi, @@ -8,7 +9,6 @@ import { clientSupportsFallback, ensureCommandShape, } from "@cursorless/lib-common"; - import type { CommandApi } from "@cursorless/lib-engine"; import type { NeovimIDE } from "@cursorless/lib-neovim-common"; import { @@ -16,7 +16,6 @@ import { modeSwitchTerminal, } from "@cursorless/lib-neovim-common"; import { getNeovimRegistry } from "@cursorless/lib-neovim-registry"; -import type { NeovimClient } from "neovim"; export async function registerCommands( client: NeovimClient, diff --git a/packages/app-talonjs/src/extension.ts b/packages/app-talonjs/src/extension.ts index 0ff6bc359e..2dda01bc8a 100644 --- a/packages/app-talonjs/src/extension.ts +++ b/packages/app-talonjs/src/extension.ts @@ -1,6 +1,6 @@ +import * as talon from "talon"; import type { RunMode } from "@cursorless/lib-common"; import { activate as activateCore } from "@cursorless/lib-talonjs-core"; -import * as talon from "talon"; export async function activate(runMode: RunMode): Promise { await activateCore(talon, runMode); diff --git a/packages/app-vscode/src/InstallationDependencies.ts b/packages/app-vscode/src/InstallationDependencies.ts index 684385a152..cd60f7d769 100644 --- a/packages/app-vscode/src/InstallationDependencies.ts +++ b/packages/app-vscode/src/InstallationDependencies.ts @@ -1,10 +1,10 @@ -import { isWindows } from "@cursorless/lib-node-common"; -import { COMMAND_SERVER_EXTENSION_ID } from "@cursorless/lib-vscode-common"; -import glob from "fast-glob"; import * as fs from "node:fs"; import * as os from "node:os"; import * as path from "node:path"; +import glob from "fast-glob"; import * as vscode from "vscode"; +import { isWindows } from "@cursorless/lib-node-common"; +import { COMMAND_SERVER_EXTENSION_ID } from "@cursorless/lib-vscode-common"; const STATE_KEY = "dontShowInstallationDependencies"; diff --git a/packages/app-vscode/src/ReleaseNotes.test.ts b/packages/app-vscode/src/ReleaseNotes.test.ts index c832f7ac4c..03ea83bac1 100644 --- a/packages/app-vscode/src/ReleaseNotes.test.ts +++ b/packages/app-vscode/src/ReleaseNotes.test.ts @@ -1,9 +1,9 @@ import * as sinon from "sinon"; +import type { ExtensionContext, Uri } from "vscode"; import type { MessageType, Messages } from "@cursorless/lib-common"; import { asyncSafety } from "@cursorless/lib-common"; -import type { ExtensionContext, Uri } from "vscode"; -import { ReleaseNotes, VERSION_KEY, WHATS_NEW } from "./ReleaseNotes"; import type { VscodeApi } from "@cursorless/lib-vscode-common"; +import { ReleaseNotes, VERSION_KEY, WHATS_NEW } from "./ReleaseNotes"; interface Input { /** Whether the VSCode window is focused */ diff --git a/packages/app-vscode/src/ReleaseNotes.ts b/packages/app-vscode/src/ReleaseNotes.ts index 1fa709db43..656786018f 100644 --- a/packages/app-vscode/src/ReleaseNotes.ts +++ b/packages/app-vscode/src/ReleaseNotes.ts @@ -1,9 +1,9 @@ +import * as semver from "semver"; import type { ExtensionContext } from "vscode"; +import { URI } from "vscode-uri"; import type { Messages } from "@cursorless/lib-common"; import { showInfo } from "@cursorless/lib-common"; -import * as semver from "semver"; import type { VscodeApi } from "@cursorless/lib-vscode-common"; -import { URI } from "vscode-uri"; /** * The key to use in global storage to detect when Cursorless version number has diff --git a/packages/app-vscode/src/ScopeTreeProvider.ts b/packages/app-vscode/src/ScopeTreeProvider.ts index 25b82eb1a8..60fa8dafee 100644 --- a/packages/app-vscode/src/ScopeTreeProvider.ts +++ b/packages/app-vscode/src/ScopeTreeProvider.ts @@ -1,23 +1,3 @@ -import type { - CursorlessCommandId, - IDE, - ScopeProvider, - ScopeSupportInfo, - ScopeType, - ScopeTypeInfo, - Selection, - TextEditor, -} from "@cursorless/lib-common"; -import { - CURSORLESS_SCOPE_TREE_VIEW_ID, - DOCS_URL, - ScopeSupport, - disposableFrom, - serializeScopeType, - uriEncodeHashId, -} from "@cursorless/lib-common"; -import { type CustomSpokenFormGenerator } from "@cursorless/lib-engine"; -import { type VscodeApi } from "@cursorless/lib-vscode-common"; import { isEqual } from "lodash-es"; import type { Disposable, @@ -38,6 +18,26 @@ import { window, } from "vscode"; import { URI } from "vscode-uri"; +import type { + CursorlessCommandId, + IDE, + ScopeProvider, + ScopeSupportInfo, + ScopeType, + ScopeTypeInfo, + Selection, + TextEditor, +} from "@cursorless/lib-common"; +import { + CURSORLESS_SCOPE_TREE_VIEW_ID, + DOCS_URL, + ScopeSupport, + disposableFrom, + serializeScopeType, + uriEncodeHashId, +} from "@cursorless/lib-common"; +import { type CustomSpokenFormGenerator } from "@cursorless/lib-engine"; +import { type VscodeApi } from "@cursorless/lib-vscode-common"; import type { ScopeVisualizer, VisualizationType, diff --git a/packages/app-vscode/src/SpyWebviewView.ts b/packages/app-vscode/src/SpyWebviewView.ts index add944feea..0f802aa8ea 100644 --- a/packages/app-vscode/src/SpyWebviewView.ts +++ b/packages/app-vscode/src/SpyWebviewView.ts @@ -1,6 +1,6 @@ -import type { Disposable } from "@cursorless/lib-common"; import { cloneDeep } from "lodash-es"; import type { Uri, Webview, WebviewView } from "vscode"; +import type { Disposable } from "@cursorless/lib-common"; import type { SpyWebViewEvent } from "@cursorless/lib-vscode-common"; /** diff --git a/packages/app-vscode/src/VscodeSnippets.ts b/packages/app-vscode/src/VscodeSnippets.ts index f5def8a385..9d8b785b63 100644 --- a/packages/app-vscode/src/VscodeSnippets.ts +++ b/packages/app-vscode/src/VscodeSnippets.ts @@ -1,7 +1,7 @@ -import type { IDE, TextEditor } from "@cursorless/lib-common"; -import { type Snippets } from "@cursorless/lib-engine"; import { open } from "node:fs/promises"; import { join } from "node:path"; +import type { IDE, TextEditor } from "@cursorless/lib-common"; +import { type Snippets } from "@cursorless/lib-engine"; export class VscodeSnippets implements Snippets { constructor(private ide: IDE) {} diff --git a/packages/app-vscode/src/VscodeTutorial.ts b/packages/app-vscode/src/VscodeTutorial.ts index d6748f50fc..363ea1393b 100644 --- a/packages/app-vscode/src/VscodeTutorial.ts +++ b/packages/app-vscode/src/VscodeTutorial.ts @@ -1,10 +1,3 @@ -import type { - FileSystem, - TutorialId, - TutorialState, -} from "@cursorless/lib-common"; -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; -import type { SpyWebViewEvent, VscodeApi } from "@cursorless/lib-vscode-common"; import path from "node:path"; import type { CancellationToken, @@ -14,9 +7,16 @@ import type { WebviewViewResolveContext, } from "vscode"; import { ExtensionMode, Uri } from "vscode"; +import type { + FileSystem, + TutorialId, + TutorialState, +} from "@cursorless/lib-common"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; +import type { Tutorial } from "@cursorless/lib-tutorial"; +import type { SpyWebViewEvent, VscodeApi } from "@cursorless/lib-vscode-common"; import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; import { SpyWebviewView } from "./SpyWebviewView"; -import type { Tutorial } from "@cursorless/lib-tutorial"; const VSCODE_TUTORIAL_WEBVIEW_ID = "cursorless.tutorial"; diff --git a/packages/app-vscode/src/commands.ts b/packages/app-vscode/src/commands.ts index e962c37853..1521e32f01 100644 --- a/packages/app-vscode/src/commands.ts +++ b/packages/app-vscode/src/commands.ts @@ -1,5 +1,5 @@ -import { CURSORLESS_ORG_URL, DOCS_URL } from "@cursorless/lib-common"; import * as vscode from "vscode"; +import { CURSORLESS_ORG_URL, DOCS_URL } from "@cursorless/lib-common"; export const showDocumentation = () => { return vscode.env.openExternal(vscode.Uri.parse(DOCS_URL)); diff --git a/packages/app-vscode/src/constructTestHelpers.ts b/packages/app-vscode/src/constructTestHelpers.ts index a35f454a25..ebe6385acf 100644 --- a/packages/app-vscode/src/constructTestHelpers.ts +++ b/packages/app-vscode/src/constructTestHelpers.ts @@ -1,3 +1,4 @@ +import type * as vscode from "vscode"; import type { ExcludableSnapshotField, ExtraSnapshotField, @@ -20,7 +21,6 @@ import { } from "@cursorless/lib-engine"; import { takeSnapshot } from "@cursorless/lib-test-case-recorder"; import type { VscodeTestHelpers } from "@cursorless/lib-vscode-common"; -import type * as vscode from "vscode"; import { toVscodeEditor } from "./ide/vscode/toVscodeEditor"; import type { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; import type { VscodeIDE } from "./ide/vscode/VscodeIDE"; diff --git a/packages/app-vscode/src/createScopeVisualizer.ts b/packages/app-vscode/src/createScopeVisualizer.ts index b55f3ae89d..35ea8bb7ae 100644 --- a/packages/app-vscode/src/createScopeVisualizer.ts +++ b/packages/app-vscode/src/createScopeVisualizer.ts @@ -1,10 +1,10 @@ +import { pull } from "lodash-es"; import type { Disposable, IDE, ScopeProvider, ScopeType, } from "@cursorless/lib-common"; -import { pull } from "lodash-es"; import { type VscodeScopeVisualizer, createVscodeScopeVisualizer, diff --git a/packages/app-vscode/src/createTutorial.ts b/packages/app-vscode/src/createTutorial.ts index fa1e7cee67..0e962cc3b1 100644 --- a/packages/app-vscode/src/createTutorial.ts +++ b/packages/app-vscode/src/createTutorial.ts @@ -1,15 +1,15 @@ +import type * as vscode from "vscode"; import type { Hats, HatTokenMap, IDE } from "@cursorless/lib-common"; import type { CommandRunnerDecorator, CustomSpokenFormGenerator, } from "@cursorless/lib-engine"; -import { TutorialImpl } from "@cursorless/lib-tutorial"; import { FileSystemTutorialContentProvider } from "@cursorless/lib-node-common"; -import type * as vscode from "vscode"; -import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; -import { VscodeTutorial } from "./VscodeTutorial"; +import { TutorialImpl } from "@cursorless/lib-tutorial"; import type { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem"; +import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi"; import { vscodeApi } from "./vscodeApi"; +import { VscodeTutorial } from "./VscodeTutorial"; export function createTutorial( context: vscode.ExtensionContext, diff --git a/packages/app-vscode/src/extension.ts b/packages/app-vscode/src/extension.ts index 8746aa7820..1fba600d7a 100644 --- a/packages/app-vscode/src/extension.ts +++ b/packages/app-vscode/src/extension.ts @@ -1,3 +1,4 @@ +import type { ExtensionContext } from "vscode"; import type { EnforceUndefined } from "@cursorless/lib-common"; import { FakeCommandServerApi, @@ -20,22 +21,21 @@ import { getCommandServerApi, getParseTreeApi, } from "@cursorless/lib-vscode-common"; -import type { ExtensionContext } from "vscode"; -import { InstallationDependencies } from "./InstallationDependencies"; -import { ReleaseNotes } from "./ReleaseNotes"; -import { ScopeTreeProvider } from "./ScopeTreeProvider"; -import { StatusBarItem } from "./StatusBarItem"; -import { VscodeSnippets } from "./VscodeSnippets"; import { constructTestHelpers } from "./constructTestHelpers"; import { createScopeVisualizer } from "./createScopeVisualizer"; import { createTreeSitter } from "./createTreeSitter"; import { createTutorial } from "./createTutorial"; import { createVscodeIde } from "./createVscodeIde"; +import { InstallationDependencies } from "./InstallationDependencies"; import { KeyboardCommands } from "./keyboard/KeyboardCommands"; import { registerCommands } from "./registerCommands"; +import { ReleaseNotes } from "./ReleaseNotes"; import { revisualizeOnCustomRegexChange } from "./revisualizeOnCustomRegexChange"; +import { ScopeTreeProvider } from "./ScopeTreeProvider"; +import { StatusBarItem } from "./StatusBarItem"; import { storedTargetHighlighter } from "./storedTargetHighlighter"; import { vscodeApi } from "./vscodeApi"; +import { VscodeSnippets } from "./VscodeSnippets"; /** * Extension entrypoint called by VSCode on Cursorless startup. diff --git a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts index b1bc57a01c..74250b2d9a 100644 --- a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts +++ b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighter.ts @@ -1,17 +1,17 @@ +import { flatmap } from "itertools"; +import { range as lodashRange } from "lodash-es"; import type { GeneralizedRange, TextEditor } from "@cursorless/lib-common"; import { generateDecorationsForCharacterRange, generateDecorationsForLineRange, Range, } from "@cursorless/lib-common"; -import { flatmap } from "itertools"; -import { range as lodashRange } from "lodash-es"; import type { VscodeTextEditor } from "../../VscodeTextEditor"; import type { RangeTypeColors } from "../RangeTypeColors"; -import { VscodeFancyRangeHighlighterRenderer } from "./VscodeFancyRangeHighlighterRenderer"; import type { DifferentiatedStyledRange } from "./decorationStyle.types"; import { generateDifferentiatedRanges } from "./generateDifferentiatedRanges"; import { groupDifferentiatedStyledRanges } from "./groupDifferentiatedStyledRanges"; +import { VscodeFancyRangeHighlighterRenderer } from "./VscodeFancyRangeHighlighterRenderer"; /** * A class for highlighting ranges in a VSCode editor, which does the following: diff --git a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts index 4b2ca570ba..73efe1d01a 100644 --- a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts +++ b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/VscodeFancyRangeHighlighterRenderer.ts @@ -1,3 +1,5 @@ +import type { DecorationRenderOptions, TextEditorDecorationType } from "vscode"; +import { DecorationRangeBehavior } from "vscode"; import type { DecorationStyle } from "@cursorless/lib-common"; import { BORDER_WIDTH, @@ -7,8 +9,6 @@ import { getBorderStyle, } from "@cursorless/lib-common"; import { toVscodeRange } from "@cursorless/lib-vscode-common"; -import type { DecorationRenderOptions, TextEditorDecorationType } from "vscode"; -import { DecorationRangeBehavior } from "vscode"; import { vscodeApi } from "../../../../vscodeApi"; import type { VscodeTextEditor } from "../../VscodeTextEditor"; import type { RangeTypeColors } from "../RangeTypeColors"; diff --git a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts index f8b550071e..636b914950 100644 --- a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts +++ b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts @@ -1,10 +1,9 @@ +import { max } from "lodash-es"; import type { GeneralizedRange } from "@cursorless/lib-common"; import { generalizedRangeContains, generalizedRangeTouches, } from "@cursorless/lib-common"; - -import { max } from "lodash-es"; import type { DifferentiatedGeneralizedRange } from "./decorationStyle.types"; /** diff --git a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts index 17ac66cba7..c73bdbaded 100644 --- a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts +++ b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeRenderer.ts @@ -1,9 +1,9 @@ import type { Disposable, GeneralizedRange } from "@cursorless/lib-common"; import { isGeneralizedRangeEqual } from "@cursorless/lib-common"; import type { VscodeTextEditor } from "../VscodeTextEditor"; +import { blendRangeTypeColors } from "./blendRangeTypeColors"; import type { RangeTypeColors } from "./RangeTypeColors"; import { VscodeFancyRangeHighlighter } from "./VscodeFancyRangeHighlighter"; -import { blendRangeTypeColors } from "./blendRangeTypeColors"; export interface RendererScope { domain: GeneralizedRange; diff --git a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts index f2079af121..2e0c26cfcf 100644 --- a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts +++ b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeTargetVisualizer.ts @@ -6,8 +6,8 @@ import type { TextEditor, } from "@cursorless/lib-common"; import { toCharacterRange } from "@cursorless/lib-common"; -import { VscodeScopeVisualizer } from "./VscodeScopeVisualizer"; import type { VscodeTextEditor } from "../VscodeTextEditor"; +import { VscodeScopeVisualizer } from "./VscodeScopeVisualizer"; abstract class VscodeScopeTargetVisualizer extends VscodeScopeVisualizer { protected abstract getTargetRange( diff --git a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts index e00974e6eb..c051595cad 100644 --- a/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts +++ b/packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeScopeVisualizer.ts @@ -11,8 +11,8 @@ import type { ScopeVisualizerColorConfig, } from "@cursorless/lib-vscode-common"; import { vscodeApi } from "../../../vscodeApi"; -import { VscodeScopeRenderer } from "./VscodeScopeRenderer"; import { getColorsFromConfig } from "./getColorsFromConfig"; +import { VscodeScopeRenderer } from "./VscodeScopeRenderer"; /** * Base class for the different kinds of scope visualizer, eg content, removal, diff --git a/packages/app-vscode/src/ide/vscode/VscodeCapabilities.ts b/packages/app-vscode/src/ide/vscode/VscodeCapabilities.ts index f75b194cff..3d65df0f5a 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeCapabilities.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeCapabilities.ts @@ -1,10 +1,10 @@ +import * as semver from "semver"; +import * as vscode from "vscode"; import type { Capabilities, CommandCapabilityMap, } from "@cursorless/lib-common"; import { nodeGetRunMode } from "@cursorless/lib-node-common"; -import * as semver from "semver"; -import * as vscode from "vscode"; // FIXME: In newer versions of vscode the `editor.action.clipboardCopyAction` // command appears to be disabled / sandboxed in test mode. diff --git a/packages/app-vscode/src/ide/vscode/VscodeConfiguration.ts b/packages/app-vscode/src/ide/vscode/VscodeConfiguration.ts index abfac3f6a9..90cf32c8fa 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeConfiguration.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeConfiguration.ts @@ -1,3 +1,5 @@ +import * as os from "node:os"; +import * as vscode from "vscode"; import type { Configuration, ConfigurationScope, @@ -6,8 +8,6 @@ import type { Paths, } from "@cursorless/lib-common"; import { HatStability, Notifier } from "@cursorless/lib-common"; -import * as os from "node:os"; -import * as vscode from "vscode"; import type { VscodeIDE } from "./VscodeIDE"; type TranslatorMap = { diff --git a/packages/app-vscode/src/ide/vscode/VscodeEdit.ts b/packages/app-vscode/src/ide/vscode/VscodeEdit.ts index 03c0000127..f2f7300878 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeEdit.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeEdit.ts @@ -1,6 +1,6 @@ +import type * as vscode from "vscode"; import type { Edit } from "@cursorless/lib-common"; import { toVscodePosition, toVscodeRange } from "@cursorless/lib-vscode-common"; -import type * as vscode from "vscode"; export default async function vscodeEdit( editor: vscode.TextEditor, diff --git a/packages/app-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts b/packages/app-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts index 5430078d56..1980f3da1f 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeEnabledHatStyleManager.ts @@ -1,11 +1,11 @@ +import { pickBy } from "lodash-es"; +import * as vscode from "vscode"; import type { HatStyleInfo, HatStyleMap, Listener, } from "@cursorless/lib-common"; import { Notifier } from "@cursorless/lib-common"; -import { pickBy } from "lodash-es"; -import * as vscode from "vscode"; import type { HatColor, HatShape, VscodeHatStyleName } from "./hatStyles.types"; import { HAT_COLORS, HAT_NON_DEFAULT_SHAPES } from "./hatStyles.types"; diff --git a/packages/app-vscode/src/ide/vscode/VscodeEvents.ts b/packages/app-vscode/src/ide/vscode/VscodeEvents.ts index da020f3bab..48eb748542 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeEvents.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeEvents.ts @@ -1,3 +1,4 @@ +import * as vscode from "vscode"; import type { Disposable, Event, @@ -6,7 +7,6 @@ import type { TextDocumentContentChangeEvent, } from "@cursorless/lib-common"; import { fromVscodeRange } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; import { VscodeTextDocument } from "./VscodeTextDocument"; export function vscodeOnDidChangeTextDocument( diff --git a/packages/app-vscode/src/ide/vscode/VscodeFileSystem.ts b/packages/app-vscode/src/ide/vscode/VscodeFileSystem.ts index a1838cb751..2a79ba7027 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeFileSystem.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeFileSystem.ts @@ -1,11 +1,11 @@ +import { isAbsolute, join } from "node:path"; +import * as vscode from "vscode"; import type { Disposable, FileSystem, PathChangeListener, RunMode, } from "@cursorless/lib-common"; -import { isAbsolute, join } from "node:path"; -import * as vscode from "vscode"; export class VscodeFileSystem implements FileSystem { public readonly cursorlessTalonStateJsonPath: string; diff --git a/packages/app-vscode/src/ide/vscode/VscodeFlashHandler.ts b/packages/app-vscode/src/ide/vscode/VscodeFlashHandler.ts index 31af474028..c13636810f 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeFlashHandler.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeFlashHandler.ts @@ -1,10 +1,10 @@ +import { workspace } from "vscode"; import type { EditorGeneralizedRange, FlashDescriptor, FlashStyle, } from "@cursorless/lib-common"; import { groupBy, sleep } from "@cursorless/lib-common"; -import { workspace } from "vscode"; import type VscodeHighlights from "./VscodeHighlights"; import type { VscodeIDE } from "./VscodeIDE"; diff --git a/packages/app-vscode/src/ide/vscode/VscodeFocusEditor.ts b/packages/app-vscode/src/ide/vscode/VscodeFocusEditor.ts index 0d990895a8..88f7054935 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeFocusEditor.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeFocusEditor.ts @@ -1,6 +1,6 @@ -import { getCellIndex } from "@cursorless/lib-vscode-common"; import type { NotebookDocument, TextEditor } from "vscode"; import { commands, TabInputTextDiff, ViewColumn, window } from "vscode"; +import { getCellIndex } from "@cursorless/lib-vscode-common"; import { getNotebookFromCellDocument } from "./notebook/notebook"; import type { VscodeTextEditor } from "./VscodeTextEditor"; diff --git a/packages/app-vscode/src/ide/vscode/VscodeFold.ts b/packages/app-vscode/src/ide/vscode/VscodeFold.ts index 517cc88424..e4db9ebaf2 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeFold.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeFold.ts @@ -1,5 +1,5 @@ -import type { Range } from "@cursorless/lib-common"; import * as vscode from "vscode"; +import type { Range } from "@cursorless/lib-common"; import type { VscodeIDE } from "./VscodeIDE"; import type { VscodeTextEditor } from "./VscodeTextEditor"; diff --git a/packages/app-vscode/src/ide/vscode/VscodeHighlights.ts b/packages/app-vscode/src/ide/vscode/VscodeHighlights.ts index d57df97165..d7eb4bea8e 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeHighlights.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeHighlights.ts @@ -1,11 +1,11 @@ +import type { ExtensionContext } from "vscode"; +import * as vscode from "vscode"; import type { CharacterRange, GeneralizedRange, LineRange, } from "@cursorless/lib-common"; import { FlashStyle, isLineRange, partition } from "@cursorless/lib-common"; -import type { ExtensionContext } from "vscode"; -import * as vscode from "vscode"; import { VscodeHighlightDecorationTypes } from "./VscodeHighlightDecorationTypes"; import type { VscodeTextEditor } from "./VscodeTextEditor"; diff --git a/packages/app-vscode/src/ide/vscode/VscodeIDE.ts b/packages/app-vscode/src/ide/vscode/VscodeIDE.ts index 62bdb8d775..30b20fbd09 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeIDE.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeIDE.ts @@ -1,3 +1,8 @@ +import { pull } from "lodash-es"; +import { v4 as uuid } from "uuid"; +import type { ExtensionContext, WorkspaceFolder } from "vscode"; +import * as vscode from "vscode"; +import { window, workspace } from "vscode"; import type { Disposable, EditableTextEditor, @@ -18,11 +23,6 @@ import { fromVscodeRange, fromVscodeSelection, } from "@cursorless/lib-vscode-common"; -import { pull } from "lodash-es"; -import { v4 as uuid } from "uuid"; -import type { ExtensionContext, WorkspaceFolder } from "vscode"; -import * as vscode from "vscode"; -import { window, workspace } from "vscode"; import { VscodeCapabilities } from "./VscodeCapabilities"; import VscodeClipboard from "./VscodeClipboard"; import VscodeConfiguration from "./VscodeConfiguration"; @@ -33,9 +33,9 @@ import { VscodeNotebookEditorImpl } from "./VscodeIdeNotebook"; import VscodeKeyValueStore from "./VscodeKeyValueStore"; import VscodeMessages from "./VscodeMessages"; import { vscodeRunMode } from "./VscodeRunMode"; +import { vscodeShowQuickPick } from "./vscodeShowQuickPick"; import { VscodeTextDocument } from "./VscodeTextDocument"; import { VscodeTextEditor } from "./VscodeTextEditor"; -import { vscodeShowQuickPick } from "./vscodeShowQuickPick"; export class VscodeIDE implements IDE { readonly configuration: VscodeConfiguration; diff --git a/packages/app-vscode/src/ide/vscode/VscodeIdeNotebook.ts b/packages/app-vscode/src/ide/vscode/VscodeIdeNotebook.ts index b47b6e8a8e..9f06a658c4 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeIdeNotebook.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeIdeNotebook.ts @@ -1,11 +1,11 @@ +import type * as vscode from "vscode"; +import type { URI } from "vscode-uri"; import type { NotebookCell, NotebookCellKind, NotebookEditor, TextDocument, } from "@cursorless/lib-common"; -import type * as vscode from "vscode"; -import type { URI } from "vscode-uri"; import { VscodeTextDocument } from "./VscodeTextDocument"; export class VscodeNotebookEditorImpl implements NotebookEditor { diff --git a/packages/app-vscode/src/ide/vscode/VscodeKeyValueStore.ts b/packages/app-vscode/src/ide/vscode/VscodeKeyValueStore.ts index 5805ca0d21..2d1f13d55a 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeKeyValueStore.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeKeyValueStore.ts @@ -1,10 +1,10 @@ +import type { ExtensionContext } from "vscode"; import type { KeyValueStore, KeyValueStoreData, KeyValueStoreKey, } from "@cursorless/lib-common"; import { KEY_VALUE_STORE_DEFAULTS } from "@cursorless/lib-common"; -import type { ExtensionContext } from "vscode"; import { VERSION_KEY } from "../../ReleaseNotes"; import { DONT_SHOW_TALON_UPDATE_MESSAGE_KEY } from "../../ScopeTreeProvider"; import { PERFORMED_PR_1868_SHAPE_UPDATE_INIT_KEY } from "./hats/performPr1868ShapeUpdateInit"; diff --git a/packages/app-vscode/src/ide/vscode/VscodeOpenLink.ts b/packages/app-vscode/src/ide/vscode/VscodeOpenLink.ts index affc4c9439..895907b0aa 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeOpenLink.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeOpenLink.ts @@ -1,8 +1,8 @@ import * as vscode from "vscode"; -import type { VscodeTextEditor } from "./VscodeTextEditor"; import type { OpenLinkOptions, Range } from "@cursorless/lib-common"; import { Selection } from "@cursorless/lib-common"; import { toVscodePositionOrRange } from "@cursorless/lib-vscode-common"; +import type { VscodeTextEditor } from "./VscodeTextEditor"; export default async function vscodeOpenLink( editor: VscodeTextEditor, diff --git a/packages/app-vscode/src/ide/vscode/VscodeTextDocument.ts b/packages/app-vscode/src/ide/vscode/VscodeTextDocument.ts index baa9809c5a..5ddba2dd39 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeTextDocument.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeTextDocument.ts @@ -1,3 +1,6 @@ +import * as path from "node:path"; +import type * as vscode from "vscode"; +import type { URI } from "vscode-uri"; import type { EndOfLine, Position, @@ -11,9 +14,6 @@ import { toVscodePosition, toVscodeRange, } from "@cursorless/lib-vscode-common"; -import * as path from "node:path"; -import type * as vscode from "vscode"; -import type { URI } from "vscode-uri"; import VscodeTextLine from "./VscodeTextLine"; export class VscodeTextDocument implements TextDocument { diff --git a/packages/app-vscode/src/ide/vscode/VscodeTextEditor.ts b/packages/app-vscode/src/ide/vscode/VscodeTextEditor.ts index 74f591c9f9..8377bebd06 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeTextEditor.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeTextEditor.ts @@ -1,3 +1,4 @@ +import * as vscode from "vscode"; import type { Edit, EditableTextEditor, @@ -18,7 +19,7 @@ import { toVscodeRange, toVscodeSelection, } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; +import { isDiffEditorOriginal } from "./isDiffEditorOriginal"; import vscodeEdit from "./VscodeEdit"; import vscodeFocusEditor from "./VscodeFocusEditor"; import { vscodeFold, vscodeUnfold } from "./VscodeFold"; @@ -28,7 +29,6 @@ import vscodeOpenLink from "./VscodeOpenLink"; import { vscodeRevealLine } from "./VscodeRevealLine"; import { VscodeTextDocument } from "./VscodeTextDocument"; import { vscodeToggleBreakpoint } from "./VscodeToggleBreakpoint"; -import { isDiffEditorOriginal } from "./isDiffEditorOriginal"; export class VscodeTextEditor implements EditableTextEditor { readonly document: TextDocument; diff --git a/packages/app-vscode/src/ide/vscode/VscodeTextLine.ts b/packages/app-vscode/src/ide/vscode/VscodeTextLine.ts index 8a9eba4f92..71a9acaebe 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeTextLine.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeTextLine.ts @@ -1,7 +1,7 @@ +import type * as vscode from "vscode"; import type { TextLine } from "@cursorless/lib-common"; import { Position, Range } from "@cursorless/lib-common"; import { fromVscodeRange } from "@cursorless/lib-vscode-common"; -import type * as vscode from "vscode"; export default class VscodeTextLine implements TextLine { constructor(private line: vscode.TextLine) {} diff --git a/packages/app-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts b/packages/app-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts index 6b9944107b..c155f1434e 100644 --- a/packages/app-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts +++ b/packages/app-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts @@ -1,6 +1,6 @@ +import * as vscode from "vscode"; import type { GeneralizedRange, Position } from "@cursorless/lib-common"; import { toVscodePosition } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; import type { VscodeTextEditor } from "./VscodeTextEditor"; export async function vscodeToggleBreakpoint( diff --git a/packages/app-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts b/packages/app-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts index 2804432fb4..223bedce04 100644 --- a/packages/app-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts +++ b/packages/app-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts @@ -1,3 +1,7 @@ +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +import { cloneDeep, isEqual } from "lodash-es"; +import * as vscode from "vscode"; import type { Listener, Messages, @@ -6,15 +10,11 @@ import type { import { Notifier } from "@cursorless/lib-common"; import { walkFiles } from "@cursorless/lib-node-common"; import type { VscodeApi } from "@cursorless/lib-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 type { HatShape, VscodeHatStyleName } from "../hatStyles.types"; +import { HAT_SHAPES } from "../hatStyles.types"; import { vscodeGetConfigurationString } from "../VscodeConfiguration"; 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"; diff --git a/packages/app-vscode/src/ide/vscode/hats/VscodeHats.ts b/packages/app-vscode/src/ide/vscode/hats/VscodeHats.ts index 2d8ba0ecc9..dbfe93f03b 100644 --- a/packages/app-vscode/src/ide/vscode/hats/VscodeHats.ts +++ b/packages/app-vscode/src/ide/vscode/hats/VscodeHats.ts @@ -1,3 +1,5 @@ +import * as vscode from "vscode"; +import type { Disposable } from "vscode"; import type { HatRange, Hats, @@ -10,8 +12,6 @@ import type { import { Notifier } from "@cursorless/lib-common"; import type { VscodeApi } from "@cursorless/lib-vscode-common"; import { toVscodeRange } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; -import type { Disposable } from "vscode"; import type { VscodeHatStyleName } from "../hatStyles.types"; import VscodeEnabledHatStyleManager from "../VscodeEnabledHatStyleManager"; import type { VscodeIDE } from "../VscodeIDE"; diff --git a/packages/app-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts b/packages/app-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts index b62f0005f7..f85b4a4567 100644 --- a/packages/app-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts +++ b/packages/app-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts @@ -1,7 +1,7 @@ +import * as vscode from "vscode"; import type { Messages } from "@cursorless/lib-common"; import { showInfo } from "@cursorless/lib-common"; import type { VscodeApi } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; import type { ExtendedHatStyleMap } from "../VscodeEnabledHatStyleManager"; import type { IndividualHatAdjustmentMap } from "./shapeAdjustments"; diff --git a/packages/app-vscode/src/ide/vscode/toVscodeEditor.ts b/packages/app-vscode/src/ide/vscode/toVscodeEditor.ts index f980200bb5..a08b841148 100644 --- a/packages/app-vscode/src/ide/vscode/toVscodeEditor.ts +++ b/packages/app-vscode/src/ide/vscode/toVscodeEditor.ts @@ -1,5 +1,5 @@ -import type { TextEditor } from "@cursorless/lib-common"; import type * as vscode from "vscode"; +import type { TextEditor } from "@cursorless/lib-common"; import type { VscodeTextEditor } from "./VscodeTextEditor"; export function toVscodeEditor(editor: TextEditor): vscode.TextEditor { diff --git a/packages/app-vscode/src/ide/vscode/vscodeShowQuickPick.ts b/packages/app-vscode/src/ide/vscode/vscodeShowQuickPick.ts index 846fd942e5..7451add07f 100644 --- a/packages/app-vscode/src/ide/vscode/vscodeShowQuickPick.ts +++ b/packages/app-vscode/src/ide/vscode/vscodeShowQuickPick.ts @@ -1,5 +1,5 @@ -import type { QuickPickOptions } from "@cursorless/lib-common"; import * as vscode from "vscode"; +import type { QuickPickOptions } from "@cursorless/lib-common"; /** * Show a quick pick that allows the user to enter a new value. We do this by diff --git a/packages/app-vscode/src/keyboard/KeyboardCommandHandler.ts b/packages/app-vscode/src/keyboard/KeyboardCommandHandler.ts index d29ca5780a..1dcf9349e9 100644 --- a/packages/app-vscode/src/keyboard/KeyboardCommandHandler.ts +++ b/packages/app-vscode/src/keyboard/KeyboardCommandHandler.ts @@ -1,11 +1,11 @@ +import { isString } from "lodash-es"; +import * as vscode from "vscode"; import type { Modifier, PartialMark, SurroundingPairName, } from "@cursorless/lib-common"; import { surroundingPairsDelimiters } from "@cursorless/lib-engine"; -import { isString } from "lodash-es"; -import * as vscode from "vscode"; import type { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; import type { SimpleKeyboardActionDescriptor, diff --git a/packages/app-vscode/src/keyboard/KeyboardCommands.ts b/packages/app-vscode/src/keyboard/KeyboardCommands.ts index 80423013b4..9d70306114 100644 --- a/packages/app-vscode/src/keyboard/KeyboardCommands.ts +++ b/packages/app-vscode/src/keyboard/KeyboardCommands.ts @@ -1,9 +1,9 @@ import type { ExtensionContext } from "vscode"; +import type { VscodeApi } from "@cursorless/lib-vscode-common"; +import type { StatusBarItem } from "../StatusBarItem"; import KeyboardCommandsModal from "./KeyboardCommandsModal"; import KeyboardCommandsTargeted from "./KeyboardCommandsTargeted"; import KeyboardHandler from "./KeyboardHandler"; -import type { StatusBarItem } from "../StatusBarItem"; -import type { VscodeApi } from "@cursorless/lib-vscode-common"; export class KeyboardCommands { targeted: KeyboardCommandsTargeted; diff --git a/packages/app-vscode/src/keyboard/KeyboardCommandsModal.ts b/packages/app-vscode/src/keyboard/KeyboardCommandsModal.ts index 8979bf059e..b2250cbd44 100644 --- a/packages/app-vscode/src/keyboard/KeyboardCommandsModal.ts +++ b/packages/app-vscode/src/keyboard/KeyboardCommandsModal.ts @@ -1,17 +1,17 @@ -import { CompositeKeyMap } from "@cursorless/lib-common"; -import type { VscodeApi } from "@cursorless/lib-vscode-common"; import { pick, sortedUniq, toPairs } from "lodash-es"; import nearley from "nearley"; import * as vscode from "vscode"; +import { CompositeKeyMap } from "@cursorless/lib-common"; +import type { VscodeApi } from "@cursorless/lib-vscode-common"; +import { getTokenTypeKeyMaps } from "./getTokenTypeKeyMaps"; +import grammar from "./grammar/generated/grammar"; +import { getAcceptableTokenTypes } from "./grammar/getAcceptableTokenTypes"; import { KeyboardCommandHandler } from "./KeyboardCommandHandler"; import { KeyboardCommandsModalLayer } from "./KeyboardCommandsModalLayer"; import type KeyboardCommandsTargeted from "./KeyboardCommandsTargeted"; import { KeyboardConfig } from "./KeyboardConfig"; import type KeyboardHandler from "./KeyboardHandler"; import type { KeyDescriptor, TokenTypeKeyMapMap } from "./TokenTypeHelpers"; -import { getTokenTypeKeyMaps } from "./getTokenTypeKeyMaps"; -import grammar from "./grammar/generated/grammar"; -import { getAcceptableTokenTypes } from "./grammar/getAcceptableTokenTypes"; /** * Defines a mode to use with a modal version of Cursorless keyboard. diff --git a/packages/app-vscode/src/keyboard/KeyboardCommandsModalLayer.ts b/packages/app-vscode/src/keyboard/KeyboardCommandsModalLayer.ts index eed32c6e32..67ae8e97aa 100644 --- a/packages/app-vscode/src/keyboard/KeyboardCommandsModalLayer.ts +++ b/packages/app-vscode/src/keyboard/KeyboardCommandsModalLayer.ts @@ -1,8 +1,8 @@ -import * as vscode from "vscode"; -import type KeyboardHandler from "./KeyboardHandler"; import type TrieSearch from "trie-search"; +import * as vscode from "vscode"; import type { KeyValuePair } from "./buildSuffixTrie"; import { buildSuffixTrie } from "./buildSuffixTrie"; +import type KeyboardHandler from "./KeyboardHandler"; /** * Defines a single keyboard layer to use with a modal version of Cursorless diff --git a/packages/app-vscode/src/keyboard/KeyboardCommandsTargeted.ts b/packages/app-vscode/src/keyboard/KeyboardCommandsTargeted.ts index dafaeaea7e..a6da9f6e37 100644 --- a/packages/app-vscode/src/keyboard/KeyboardCommandsTargeted.ts +++ b/packages/app-vscode/src/keyboard/KeyboardCommandsTargeted.ts @@ -1,3 +1,4 @@ +import * as vscode from "vscode"; import type { ActionDescriptor, Modifier, @@ -8,12 +9,11 @@ import type { } from "@cursorless/lib-common"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { runCursorlessCommand } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; -import type { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; import { getStyleName } from "../ide/vscode/hats/getStyleName"; +import type { HatColor, HatShape } from "../ide/vscode/hatStyles.types"; +import type { 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/app-vscode/src/keyboard/KeyboardConfig.ts b/packages/app-vscode/src/keyboard/KeyboardConfig.ts index 29ccf05022..11b4904520 100644 --- a/packages/app-vscode/src/keyboard/KeyboardConfig.ts +++ b/packages/app-vscode/src/keyboard/KeyboardConfig.ts @@ -1,8 +1,8 @@ import { mapValues, pickBy } from "lodash-es"; +import { TextEditorCursorStyle } from "vscode"; +import type { VscodeApi } from "@cursorless/lib-vscode-common"; import type { KeyMap, SectionName, TokenType } from "./TokenTypeHelpers"; import type { SectionTypes, TokenTypeValueMap } from "./TokenTypes"; -import type { VscodeApi } from "@cursorless/lib-vscode-common"; -import { TextEditorCursorStyle } from "vscode"; const LEGACY_PLURAL_SECTION_NAMES: Record = { action: "actions", diff --git a/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts b/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts index 6e93313a1c..e88cef202d 100644 --- a/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts +++ b/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts @@ -1,7 +1,7 @@ import * as assert from "node:assert/strict"; +import { isEqual, sortBy, uniq, uniqWith } from "lodash-es"; import type { KeyValuePair } from "./buildSuffixTrie"; import { buildSuffixTrie } from "./buildSuffixTrie"; -import { isEqual, sortBy, uniq, uniqWith } from "lodash-es"; interface TestCase { input: string[]; diff --git a/packages/app-vscode/src/keyboard/grammar/command.ts b/packages/app-vscode/src/keyboard/grammar/command.ts index 0e355d4d5c..692dac273a 100644 --- a/packages/app-vscode/src/keyboard/grammar/command.ts +++ b/packages/app-vscode/src/keyboard/grammar/command.ts @@ -1,7 +1,7 @@ -import type { KeyboardCommandArgTypes } from "../KeyboardCommandTypeHelpers"; -import type { CommandRulePostProcessor } from "./CommandRulePostProcessor"; import type { ArgExtractor, Unused } from "@cursorless/lib-engine"; import { getArgExtractors, constructPayload } from "@cursorless/lib-engine"; +import type { KeyboardCommandArgTypes } from "../KeyboardCommandTypeHelpers"; +import type { CommandRulePostProcessor } from "./CommandRulePostProcessor"; /** * Creates a postprocess function for a top-level rule of our grammar. This is a diff --git a/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts b/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts index f7a837df7d..e10a2421f9 100644 --- a/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts +++ b/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts @@ -1,4 +1,5 @@ import * as assert from "node:assert/strict"; +import { isEqual } from "lodash-es"; import nearley from "nearley"; import type { KeyDescriptor } from "../TokenTypeHelpers"; import grammar from "./generated/grammar"; @@ -8,7 +9,6 @@ import { NEXT, getAcceptableTokenTypes, } from "./getAcceptableTokenTypes"; -import { isEqual } from "lodash-es"; import { stringifyTokens } from "./stringifyTokens"; interface TestCase { diff --git a/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts b/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts index 8680319918..0cb72a9c83 100644 --- a/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts +++ b/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.ts @@ -1,9 +1,9 @@ -import type nearley from "nearley"; import { isEqual, times } from "lodash-es"; -import type { CommandRulePostProcessor } from "./CommandRulePostProcessor"; +import type nearley from "nearley"; import { DefaultMap, uniqWithHash } from "@cursorless/lib-common"; import type { KeyboardCommandHandler } from "../KeyboardCommandHandler"; import type { TokenType } from "../TokenTypeHelpers"; +import type { CommandRulePostProcessor } from "./CommandRulePostProcessor"; export interface AcceptableTokenType { /** diff --git a/packages/app-vscode/src/keyboard/grammar/grammar.test.ts b/packages/app-vscode/src/keyboard/grammar/grammar.test.ts index c5e649e6f1..adc6f671d3 100644 --- a/packages/app-vscode/src/keyboard/grammar/grammar.test.ts +++ b/packages/app-vscode/src/keyboard/grammar/grammar.test.ts @@ -1,9 +1,9 @@ -import nearley from "nearley"; -import grammar from "./generated/grammar"; import * as assert from "node:assert/strict"; -import type { KeyDescriptor } from "../TokenTypeHelpers"; +import nearley from "nearley"; import type { KeyboardCommandHandler } from "../KeyboardCommandHandler"; import type { KeyboardCommand } from "../KeyboardCommandTypeHelpers"; +import type { KeyDescriptor } from "../TokenTypeHelpers"; +import grammar from "./generated/grammar"; import { stringifyTokens } from "./stringifyTokens"; interface TestCase { diff --git a/packages/app-vscode/src/registerCommands.ts b/packages/app-vscode/src/registerCommands.ts index e4436e0de2..77f64a4f44 100644 --- a/packages/app-vscode/src/registerCommands.ts +++ b/packages/app-vscode/src/registerCommands.ts @@ -1,3 +1,4 @@ +import * as vscode from "vscode"; import type { CommandHistoryStorage, CursorlessCommandId, @@ -11,22 +12,21 @@ import type { ScopeTestRecorder, TestCaseRecorder, } from "@cursorless/lib-test-case-recorder"; -import * as vscode from "vscode"; -import type { InstallationDependencies } from "./InstallationDependencies"; -import type { - ScopeVisualizer, - VisualizationType, -} from "./ScopeVisualizerCommandApi"; -import type { VscodeTutorial } from "./VscodeTutorial"; import { showDocumentation, showQuickPick, showScopeVisualizerItemDocumentation, } from "./commands"; -import type { VscodeIDE } from "./ide/vscode/VscodeIDE"; import type { VscodeHats } from "./ide/vscode/hats/VscodeHats"; +import type { VscodeIDE } from "./ide/vscode/VscodeIDE"; +import type { InstallationDependencies } from "./InstallationDependencies"; import type { KeyboardCommands } from "./keyboard/KeyboardCommands"; import { logQuickActions } from "./logQuickActions"; +import type { + ScopeVisualizer, + VisualizationType, +} from "./ScopeVisualizerCommandApi"; +import type { VscodeTutorial } from "./VscodeTutorial"; export function registerCommands( extensionContext: vscode.ExtensionContext, diff --git a/packages/app-vscode/src/revisualizeOnCustomRegexChange.ts b/packages/app-vscode/src/revisualizeOnCustomRegexChange.ts index 3c5eeba746..a452e4fca3 100644 --- a/packages/app-vscode/src/revisualizeOnCustomRegexChange.ts +++ b/packages/app-vscode/src/revisualizeOnCustomRegexChange.ts @@ -1,10 +1,10 @@ +import { isEqual } from "lodash-es"; import type { Disposable, ScopeProvider, ScopeTypeInfo, } from "@cursorless/lib-common"; import { disposableFrom } from "@cursorless/lib-common"; -import { isEqual } from "lodash-es"; import type { ScopeVisualizer, VisualizationType, diff --git a/packages/app-vscode/src/scripts/initLaunchSandbox.ts b/packages/app-vscode/src/scripts/initLaunchSandbox.ts index 0ff3ae4476..f232cbf07f 100644 --- a/packages/app-vscode/src/scripts/initLaunchSandbox.ts +++ b/packages/app-vscode/src/scripts/initLaunchSandbox.ts @@ -1,10 +1,10 @@ +import * as cp from "node:child_process"; /** * This script creates a VSCode settings profile for Cursorless development, * allowing you to have a separate set of extensions and settings for use when * developing the Cursorless VSCode extension locally. */ import { extensionDependencies } from "@cursorless/lib-common"; -import * as cp from "node:child_process"; const vsCodeToolName: string = "code"; const validCliToolParams: Array = ["--code", "--codium"]; diff --git a/packages/app-vscode/src/scripts/populateDist/assets.ts b/packages/app-vscode/src/scripts/populateDist/assets.ts index 271b6c482a..00215cebad 100644 --- a/packages/app-vscode/src/scripts/populateDist/assets.ts +++ b/packages/app-vscode/src/scripts/populateDist/assets.ts @@ -1,6 +1,6 @@ -import { transformPackageJson } from "./transformPackageJson"; -import { generateBuildInfo } from "./generateBuildInfo"; import type { Asset } from "./Asset"; +import { generateBuildInfo } from "./generateBuildInfo"; +import { transformPackageJson } from "./transformPackageJson"; export const assets: Asset[] = [ { source: "../../CHANGELOG.md", destination: "CHANGELOG.md" }, diff --git a/packages/app-vscode/src/scripts/populateDist/generateBuildInfo.ts b/packages/app-vscode/src/scripts/populateDist/generateBuildInfo.ts index cfda13df8d..c344fc97aa 100644 --- a/packages/app-vscode/src/scripts/populateDist/generateBuildInfo.ts +++ b/packages/app-vscode/src/scripts/populateDist/generateBuildInfo.ts @@ -1,6 +1,6 @@ import { getEnvironmentVariableStrict } from "@cursorless/lib-common"; -import { runCommand } from "./runCommand"; import type { Context } from "./context"; +import { runCommand } from "./runCommand"; export async function generateBuildInfo({ isCi }: Context) { // In CI, we generate a file called `build-info.json` that contains diff --git a/packages/app-vscode/src/scripts/populateDist/populateDist.ts b/packages/app-vscode/src/scripts/populateDist/populateDist.ts index 33d1d500da..9c7b6feb67 100644 --- a/packages/app-vscode/src/scripts/populateDist/populateDist.ts +++ b/packages/app-vscode/src/scripts/populateDist/populateDist.ts @@ -1,7 +1,7 @@ // Copies files into `dist` directory for packaging -import { copy, exists } from "fs-extra"; import { lstat, mkdir, readFile, rm, writeFile } from "node:fs/promises"; import * as path from "node:path"; +import { copy, exists } from "fs-extra"; import { assets } from "./assets"; import type { Context } from "./context"; diff --git a/packages/app-vscode/src/scripts/preprocessSvgHats.ts b/packages/app-vscode/src/scripts/preprocessSvgHats.ts index 822d91beed..0706f92359 100644 --- a/packages/app-vscode/src/scripts/preprocessSvgHats.ts +++ b/packages/app-vscode/src/scripts/preprocessSvgHats.ts @@ -1,7 +1,7 @@ -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; -import * as parser from "fast-xml-parser"; import { promises as fsp, readdirSync } from "node:fs"; import * as path from "node:path"; +import * as parser from "fast-xml-parser"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; async function main() { const directory = path.join(getCursorlessRepoRoot(), "resources/images/hats"); diff --git a/packages/app-vscode/src/storedTargetHighlighter.ts b/packages/app-vscode/src/storedTargetHighlighter.ts index 787db5f7cd..4ce74b0729 100644 --- a/packages/app-vscode/src/storedTargetHighlighter.ts +++ b/packages/app-vscode/src/storedTargetHighlighter.ts @@ -1,3 +1,4 @@ +import { mapValues } from "lodash-es"; import type { StoredTargetKey } from "@cursorless/lib-common"; import { groupBy, toCharacterRange } from "@cursorless/lib-common"; import type { StoredTargetMap } from "@cursorless/lib-engine"; @@ -6,9 +7,8 @@ import type { ScopeVisualizerColorConfig, } from "@cursorless/lib-vscode-common"; 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"; +import { VscodeFancyRangeHighlighter } from "./ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter"; import { usingSetting } from "./usingSetting"; const targetColorMap: Partial> = { diff --git a/packages/app-vscode/src/usingSetting.ts b/packages/app-vscode/src/usingSetting.ts index ffb4fd3203..064afe88a8 100644 --- a/packages/app-vscode/src/usingSetting.ts +++ b/packages/app-vscode/src/usingSetting.ts @@ -1,5 +1,5 @@ -import { vscodeApi } from "./vscodeApi"; import type { Disposable } from "@cursorless/lib-common"; +import { vscodeApi } from "./vscodeApi"; /** * Watches for changes to a setting and calls a factory function whenever the diff --git a/packages/app-vscode/src/vscodeApi.ts b/packages/app-vscode/src/vscodeApi.ts index 70ddc1abed..9c5e5c4b03 100644 --- a/packages/app-vscode/src/vscodeApi.ts +++ b/packages/app-vscode/src/vscodeApi.ts @@ -1,5 +1,5 @@ -import type { VscodeApi } from "@cursorless/lib-vscode-common"; import { commands, env, window, workspace } from "vscode"; +import type { VscodeApi } from "@cursorless/lib-vscode-common"; /** * A very thin wrapper around the VSCode API that allows us to mock it for diff --git a/packages/app-web-docs/docusaurus.config.mts b/packages/app-web-docs/docusaurus.config.mts index 5d978035ac..e8101aedca 100644 --- a/packages/app-web-docs/docusaurus.config.mts +++ b/packages/app-web-docs/docusaurus.config.mts @@ -1,8 +1,8 @@ -import type { Config } from "@docusaurus/types"; -import type { Root } from "mdast"; import { createRequire } from "node:module"; -import { fileURLToPath } from "node:url"; import { dirname, extname, relative, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import type { Config } from "@docusaurus/types"; +import type { Root } from "mdast"; import { themes } from "prism-react-renderer"; import type { Transformer } from "unified"; import { visit } from "unist-util-visit"; diff --git a/packages/app-web-docs/src/docs/components/Header.tsx b/packages/app-web-docs/src/docs/components/Header.tsx index e38d0454b4..e581e4f95e 100644 --- a/packages/app-web-docs/src/docs/components/Header.tsx +++ b/packages/app-web-docs/src/docs/components/Header.tsx @@ -1,5 +1,5 @@ -import { uriEncodeHashId } from "@cursorless/lib-common"; import React from "react"; +import { uriEncodeHashId } from "@cursorless/lib-common"; import "./Header.css"; interface Props { diff --git a/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx b/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx index 2949af4907..1e4d3bdde4 100644 --- a/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx +++ b/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx @@ -1,3 +1,5 @@ +import { usePluginData } from "@docusaurus/useGlobalData"; +import React, { useState } from "react"; import type { ScopeSupportFacetInfo, ScopeTypeType, @@ -7,8 +9,6 @@ import { prettifyScopeType, serializeScopeType, } from "@cursorless/lib-common"; -import { usePluginData } from "@docusaurus/useGlobalData"; -import React, { useState } from "react"; import { generateDecorations } from "./calculateHighlights"; import { Code } from "./Code"; import { H2, H3, H4, H5 } from "./Header"; diff --git a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx index 6f1219e55e..4ea4343e5d 100644 --- a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx +++ b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx @@ -1,5 +1,5 @@ -import { useEffect } from "react"; import { useLocation } from "@docusaurus/router"; +import { useEffect } from "react"; /** * Scrolls to the element with the ID matching the current hash in the URL. diff --git a/packages/app-web-docs/src/docs/components/calculateHighlights.ts b/packages/app-web-docs/src/docs/components/calculateHighlights.ts index 45f4925a90..eb52207631 100644 --- a/packages/app-web-docs/src/docs/components/calculateHighlights.ts +++ b/packages/app-web-docs/src/docs/components/calculateHighlights.ts @@ -1,10 +1,10 @@ +import type { DecorationItem } from "shiki"; import type { DecorationStyle } from "@cursorless/lib-common"; import { generateDecorationsForCharacterRange, Range, useSingleCornerBorderRadius, } from "@cursorless/lib-common"; -import type { DecorationItem } from "shiki"; import { flattenHighlights } from "./flattenHighlights"; import { highlightColors } from "./highlightColors"; import { highlightsToDecorations } from "./highlightsToDecorations"; diff --git a/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts b/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts index 8f5e426625..b8f4394d3c 100644 --- a/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts +++ b/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts @@ -1,5 +1,5 @@ -import { BorderStyle, Range } from "@cursorless/lib-common"; import * as assert from "node:assert/strict"; +import { BorderStyle, Range } from "@cursorless/lib-common"; import { flattenHighlights } from "./flattenHighlights"; import type { Highlight, Scope } from "./types"; diff --git a/packages/app-web-docs/src/docs/components/highlightsToDecorations.ts b/packages/app-web-docs/src/docs/components/highlightsToDecorations.ts index 81305d6be9..40647ca471 100644 --- a/packages/app-web-docs/src/docs/components/highlightsToDecorations.ts +++ b/packages/app-web-docs/src/docs/components/highlightsToDecorations.ts @@ -1,10 +1,10 @@ +import type { DecorationItem } from "shiki"; import { BORDER_RADIUS, BORDER_WIDTH, getBorderColor, getBorderStyle, } from "@cursorless/lib-common"; -import type { DecorationItem } from "shiki"; import type { BorderRadius, Highlight, Style } from "./types"; export function highlightsToDecorations( diff --git a/packages/app-web-docs/src/docs/contributing/MissingLanguageScopes.tsx b/packages/app-web-docs/src/docs/contributing/MissingLanguageScopes.tsx index d8c1416a4a..121ba936c9 100644 --- a/packages/app-web-docs/src/docs/contributing/MissingLanguageScopes.tsx +++ b/packages/app-web-docs/src/docs/contributing/MissingLanguageScopes.tsx @@ -1,3 +1,4 @@ +import React, { useState } from "react"; import type { ScopeSupportFacet } from "@cursorless/lib-common"; import { languageScopeSupport, @@ -6,7 +7,6 @@ import { scopeSupportFacets, serializeScopeType, } from "@cursorless/lib-common"; -import React, { useState } from "react"; export function MissingLanguageScopes(): React.JSX.Element { const [showPrivate, setShowPrivate] = useState(false); diff --git a/packages/app-web-docs/src/docs/contributing/scopes/components/Scopes.tsx b/packages/app-web-docs/src/docs/contributing/scopes/components/Scopes.tsx index 26ac5b4480..d50f2f185f 100644 --- a/packages/app-web-docs/src/docs/contributing/scopes/components/Scopes.tsx +++ b/packages/app-web-docs/src/docs/contributing/scopes/components/Scopes.tsx @@ -1,5 +1,5 @@ -import type { ScopeTypeType } from "@cursorless/lib-common"; import React from "react"; +import type { ScopeTypeType } from "@cursorless/lib-common"; import { DynamicTOC } from "../../../components/DynamicTOC"; import { ScopeVisualizer } from "../../../components/ScopeVisualizer"; import { ScrollToHashId } from "../../../components/ScrollToHashId"; diff --git a/packages/app-web-docs/src/plugins/scope-tests-plugin.ts b/packages/app-web-docs/src/plugins/scope-tests-plugin.ts index 64a1527516..812db72990 100644 --- a/packages/app-web-docs/src/plugins/scope-tests-plugin.ts +++ b/packages/app-web-docs/src/plugins/scope-tests-plugin.ts @@ -1,12 +1,12 @@ +import * as fs from "node:fs"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import type { LoadContext, Plugin, PluginOptions } from "@docusaurus/types"; import type { ScopeTestPath } from "@cursorless/lib-node-common"; import { getScopeTestLanguagesRecursively, getScopeTestPaths, } from "@cursorless/lib-node-common"; -import type { LoadContext, Plugin, PluginOptions } from "@docusaurus/types"; -import * as fs from "node:fs"; -import * as path from "node:path"; -import { fileURLToPath } from "node:url"; import type { Fixture, Scope, diff --git a/packages/app-web-docs/src/theme/Root.tsx b/packages/app-web-docs/src/theme/Root.tsx index 9806ac973b..ef4fa92711 100644 --- a/packages/app-web-docs/src/theme/Root.tsx +++ b/packages/app-web-docs/src/theme/Root.tsx @@ -1,5 +1,5 @@ -import React, { useEffect } from "react"; import type { Props } from "@theme/Root"; +import React, { useEffect } from "react"; function syncBootstrapTheme() { const root = document.documentElement; diff --git a/packages/app-web/src/LandingPage.tsx b/packages/app-web/src/LandingPage.tsx index f1eea1671d..8eb5c93652 100644 --- a/packages/app-web/src/LandingPage.tsx +++ b/packages/app-web/src/LandingPage.tsx @@ -1,8 +1,8 @@ import { Button } from "./Button"; -import { EmbeddedVideo } from "./EmbeddedVideo"; -import { Title } from "./Title"; import { DESCRIPTION, NAME, TITLE, YOUTUBE_SLUG } from "./constants"; +import { EmbeddedVideo } from "./EmbeddedVideo"; import Logo from "./logo.svg?react"; +import { Title } from "./Title"; export function LandingPage() { return ( diff --git a/packages/app-web/vite.config.ts b/packages/app-web/vite.config.ts index b7ef3e2990..07b32107a6 100644 --- a/packages/app-web/vite.config.ts +++ b/packages/app-web/vite.config.ts @@ -1,9 +1,9 @@ -import { CURSORLESS_ORG_URL } from "@cursorless/lib-common"; -import { viteHtmlParams, vitePreactAlias } from "@cursorless/lib-common/vite"; import type { UserConfig } from "vite"; import { defineConfig } from "vite"; import purgeCss from "vite-plugin-purgecss"; import svgr from "vite-plugin-svgr"; +import { CURSORLESS_ORG_URL } from "@cursorless/lib-common"; +import { viteHtmlParams, vitePreactAlias } from "@cursorless/lib-common/vite"; import { DESCRIPTION, TITLE, diff --git a/packages/lib-cheatsheet-local/src/test/app.spec.tsx b/packages/lib-cheatsheet-local/src/test/app.spec.tsx index 0b1344915e..6ab8ec70d9 100644 --- a/packages/lib-cheatsheet-local/src/test/app.spec.tsx +++ b/packages/lib-cheatsheet-local/src/test/app.spec.tsx @@ -1,6 +1,6 @@ -import { fakeCheatsheetInfo } from "@cursorless/lib-cheatsheet"; import { render } from "preact"; import { act } from "preact/test-utils"; +import { fakeCheatsheetInfo } from "@cursorless/lib-cheatsheet"; import { App } from "../app"; describe("App", () => { diff --git a/packages/lib-cheatsheet-local/vite.config.ts b/packages/lib-cheatsheet-local/vite.config.ts index ab4eb0c5ba..ba2bd565ff 100644 --- a/packages/lib-cheatsheet-local/vite.config.ts +++ b/packages/lib-cheatsheet-local/vite.config.ts @@ -1,8 +1,8 @@ -import defaultCheatsheetInfo from "@cursorless/lib-cheatsheet/defaultSpokenForms"; -import { viteHtmlParams, vitePreactAlias } from "@cursorless/lib-common/vite"; import { defineConfig, type UserConfig } from "vite"; import purgeCss from "vite-plugin-purgecss"; import { viteSingleFile } from "vite-plugin-singlefile"; +import defaultCheatsheetInfo from "@cursorless/lib-cheatsheet/defaultSpokenForms"; +import { viteHtmlParams, vitePreactAlias } from "@cursorless/lib-common/vite"; export default defineConfig((): UserConfig => { return { diff --git a/packages/lib-cheatsheet/src/lib/CheatsheetListSection.tsx b/packages/lib-cheatsheet/src/lib/CheatsheetListSection.tsx index c00d8fd09e..9d6db7359b 100644 --- a/packages/lib-cheatsheet/src/lib/CheatsheetListSection.tsx +++ b/packages/lib-cheatsheet/src/lib/CheatsheetListSection.tsx @@ -1,7 +1,7 @@ import type { JSX } from "preact"; import type { CheatsheetSection, Variation } from "./cheatsheet.types"; -import useIsHighlighted from "./utils/useIsHighlighted"; import { formatCaptures } from "./utils/formatCaptures"; +import useIsHighlighted from "./utils/useIsHighlighted"; type Props = { section: CheatsheetSection; diff --git a/packages/lib-common/scripts/c-tsx.js b/packages/lib-common/scripts/c-tsx.js index bfe7f4615b..ce50241afd 100755 --- a/packages/lib-common/scripts/c-tsx.js +++ b/packages/lib-common/scripts/c-tsx.js @@ -4,9 +4,9 @@ // This script runs a TypeScript file using tsx after setting repo-specific // environment variables. -import { spawn } from "cross-spawn"; -import { fileURLToPath } from "node:url"; import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { spawn } from "cross-spawn"; /** * Run a command with arguments and return a child process diff --git a/packages/lib-common/src/ide/fake/FakeIDE.ts b/packages/lib-common/src/ide/fake/FakeIDE.ts index 2435fcbcdc..a3dd9f8b3c 100644 --- a/packages/lib-common/src/ide/fake/FakeIDE.ts +++ b/packages/lib-common/src/ide/fake/FakeIDE.ts @@ -4,15 +4,13 @@ import type { NotebookEditor } from "../../types/NotebookEditor"; import type { TextDocument } from "../../types/TextDocument"; import type { EditableTextEditor, TextEditor } from "../../types/TextEditor"; import type { TextDocumentChangeEvent } from "../types/Events"; -import type { FlashDescriptor } from "../types/FlashDescriptor"; -import type { Messages } from "../types/Messages"; -import type { QuickPickOptions } from "../types/QuickPickOptions"; import type { Emit, Event, TextEditorSelectionChangeEvent, TextEditorVisibleRangesChangeEvent, } from "../types/events.types"; +import type { FlashDescriptor } from "../types/FlashDescriptor"; import type { Disposable, EmittableIDE, @@ -20,6 +18,8 @@ import type { RunMode, WorkspaceFolder, } from "../types/ide.types"; +import type { Messages } from "../types/Messages"; +import type { QuickPickOptions } from "../types/QuickPickOptions"; import { FakeCapabilities } from "./FakeCapabilities"; import FakeClipboard from "./FakeClipboard"; import FakeConfiguration from "./FakeConfiguration"; diff --git a/packages/lib-common/src/ide/inMemoryTextEditor/InMemoryTextEditor.ts b/packages/lib-common/src/ide/inMemoryTextEditor/InMemoryTextEditor.ts index 0fd16994f4..0a3516d98e 100644 --- a/packages/lib-common/src/ide/inMemoryTextEditor/InMemoryTextEditor.ts +++ b/packages/lib-common/src/ide/inMemoryTextEditor/InMemoryTextEditor.ts @@ -1,3 +1,4 @@ +import { URI } from "vscode-uri"; import type { Edit, EditableTextEditor, @@ -13,7 +14,6 @@ import type { TextEditorOptions, } from "@cursorless/lib-common"; import { Selection, selectionsEqual } from "@cursorless/lib-common"; -import { URI } from "vscode-uri"; import { InMemoryTextDocument } from "./InMemoryTextDocument"; interface Params { diff --git a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts index 7a7bd3664d..bfcd3db01c 100644 --- a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts +++ b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts @@ -1,5 +1,5 @@ -import { range } from "lodash-es"; import * as assert from "node:assert/strict"; +import { range } from "lodash-es"; import { createTestDocument } from "./createTestDocument"; interface TestCaseFixture { diff --git a/packages/lib-common/src/ide/normalized/NormalizedIDE.ts b/packages/lib-common/src/ide/normalized/NormalizedIDE.ts index 7f54a05bb4..04fb7cd6dd 100644 --- a/packages/lib-common/src/ide/normalized/NormalizedIDE.ts +++ b/packages/lib-common/src/ide/normalized/NormalizedIDE.ts @@ -1,8 +1,8 @@ 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 type FakeKeyValueStore from "../fake/FakeKeyValueStore"; import { PassthroughIDE } from "../PassthroughIDE"; import type { FlashDescriptor } from "../types/FlashDescriptor"; import type { IDE } from "../types/ide.types"; diff --git a/packages/lib-common/src/testUtil/extractTargetedMarks.ts b/packages/lib-common/src/testUtil/extractTargetedMarks.ts index 454dc43571..79ddea61e7 100644 --- a/packages/lib-common/src/testUtil/extractTargetedMarks.ts +++ b/packages/lib-common/src/testUtil/extractTargetedMarks.ts @@ -1,6 +1,6 @@ -import { splitKey } from "../util/splitKey"; import type { ReadOnlyHatMap } from "../types/HatTokenMap"; import type { Token } from "../types/Token"; +import { splitKey } from "../util/splitKey"; export function extractTargetedMarks( targetKeys: string[], diff --git a/packages/lib-common/src/testUtil/getSnapshotForComparison.ts b/packages/lib-common/src/testUtil/getSnapshotForComparison.ts index a1b2d6fd96..ac5d5d1c5a 100644 --- a/packages/lib-common/src/testUtil/getSnapshotForComparison.ts +++ b/packages/lib-common/src/testUtil/getSnapshotForComparison.ts @@ -1,13 +1,13 @@ -import { storedTargetKeys } from "../StoredTargetKey"; import type { SpyIDE } from "../ide/spy/SpyIDE"; +import { storedTargetKeys } from "../StoredTargetKey"; import type { ReadOnlyHatMap } from "../types/HatTokenMap"; import type { TestHelpers } from "../types/TestHelpers"; import { marksToPlainObject } from "../util/toPlainObject"; +import { extractTargetedMarks } from "./extractTargetedMarks"; import type { ExcludableSnapshotField, TestCaseSnapshot, } from "./TestCaseSnapshot"; -import { extractTargetedMarks } from "./extractTargetedMarks"; /** * Get the state of the editor to compare with the expected state of a test case diff --git a/packages/lib-common/src/testUtil/serializeTestFixture.ts b/packages/lib-common/src/testUtil/serializeTestFixture.ts index 59caadccba..7acd42c28c 100644 --- a/packages/lib-common/src/testUtil/serializeTestFixture.ts +++ b/packages/lib-common/src/testUtil/serializeTestFixture.ts @@ -1,7 +1,7 @@ -import type { TestCaseFixtureLegacy } from "../types/TestCaseFixture"; import type { ActionDescriptor } from "../types/command/ActionDescriptor"; -import type { CommandV7 } from "../types/command/CommandV7.types"; import type { Command } from "../types/command/command.types"; +import type { CommandV7 } from "../types/command/CommandV7.types"; +import type { TestCaseFixtureLegacy } from "../types/TestCaseFixture"; import type { EnforceUndefined } from "../util/typeUtils"; import { serialize } from "./serialize"; diff --git a/packages/lib-common/src/types/Position.ts b/packages/lib-common/src/types/Position.ts index f78fb21214..bdaa9bab43 100644 --- a/packages/lib-common/src/types/Position.ts +++ b/packages/lib-common/src/types/Position.ts @@ -1,6 +1,6 @@ import { stringToInteger } from "../util/stringUtils"; -import type { TextDocument } from "./TextDocument"; import { Range } from "./Range"; +import type { TextDocument } from "./TextDocument"; export class Position { /** diff --git a/packages/lib-common/src/types/ScopeProvider.ts b/packages/lib-common/src/types/ScopeProvider.ts index b3c5da5bba..cf1c485286 100644 --- a/packages/lib-common/src/types/ScopeProvider.ts +++ b/packages/lib-common/src/types/ScopeProvider.ts @@ -1,9 +1,9 @@ +import type { Disposable } from "../ide/types/ide.types"; +import type { ScopeType } from "./command/PartialTargetDescriptor.types"; import type { GeneralizedRange } from "./GeneralizedRange"; -import type { SpokenForm } from "./SpokenForm"; import type { Range } from "./Range"; +import type { SpokenForm } from "./SpokenForm"; import type { TextEditor } from "./TextEditor"; -import type { Disposable } from "../ide/types/ide.types"; -import type { ScopeType } from "./command/PartialTargetDescriptor.types"; export interface ScopeProvider { /** diff --git a/packages/lib-common/src/types/TestCaseFixture.ts b/packages/lib-common/src/types/TestCaseFixture.ts index 7d761dbb49..d0d57da488 100644 --- a/packages/lib-common/src/types/TestCaseFixture.ts +++ b/packages/lib-common/src/types/TestCaseFixture.ts @@ -1,7 +1,7 @@ -import type { FocusedElementType } from "./CommandServerApi"; -import type { Command, CommandLatest, Fallback } from "./command/command.types"; -import type { TestCaseSnapshot } from "../testUtil/TestCaseSnapshot"; import type { PlainSpyIDERecordedValues } from "../testUtil/spyToPlainObject"; +import type { TestCaseSnapshot } from "../testUtil/TestCaseSnapshot"; +import type { Command, CommandLatest, Fallback } from "./command/command.types"; +import type { FocusedElementType } from "./CommandServerApi"; export type ThrownError = { name: string; diff --git a/packages/lib-common/src/types/TreeSitter.ts b/packages/lib-common/src/types/TreeSitter.ts index 947bf00cc7..f255374e4c 100644 --- a/packages/lib-common/src/types/TreeSitter.ts +++ b/packages/lib-common/src/types/TreeSitter.ts @@ -1,5 +1,5 @@ -import type { TextDocument } from "@cursorless/lib-common"; import type { Query, Tree } from "web-tree-sitter"; +import type { TextDocument } from "@cursorless/lib-common"; export interface TreeSitter { /** diff --git a/packages/lib-common/src/types/command/ActionDescriptor.ts b/packages/lib-common/src/types/command/ActionDescriptor.ts index 5f17322672..a492cf8844 100644 --- a/packages/lib-common/src/types/command/ActionDescriptor.ts +++ b/packages/lib-common/src/types/command/ActionDescriptor.ts @@ -1,8 +1,8 @@ +import type { DestinationDescriptor } from "./DestinationDescriptor.types"; import type { PartialTargetDescriptor, ScopeType, } from "./PartialTargetDescriptor.types"; -import type { DestinationDescriptor } from "./DestinationDescriptor.types"; /** * A simple action takes only a single target and no other arguments. diff --git a/packages/lib-common/src/types/command/command.types.ts b/packages/lib-common/src/types/command/command.types.ts index c521123a9e..7f38fdb602 100644 --- a/packages/lib-common/src/types/command/command.types.ts +++ b/packages/lib-common/src/types/command/command.types.ts @@ -1,12 +1,12 @@ import type { ActionDescriptor } from "./ActionDescriptor"; import type { CommandV6 } from "./CommandV6.types"; import type { CommandV7 } from "./CommandV7.types"; -import type { Modifier } from "./PartialTargetDescriptor.types"; import type { CommandV0, CommandV1 } from "./legacy/CommandV0V1.types"; import type { CommandV2 } from "./legacy/CommandV2.types"; import type { CommandV3 } from "./legacy/CommandV3.types"; import type { CommandV4 } from "./legacy/CommandV4.types"; import type { CommandV5 } from "./legacy/CommandV5.types"; +import type { Modifier } from "./PartialTargetDescriptor.types"; export type CommandComplete = Required> & Pick; diff --git a/packages/lib-common/src/types/command/legacy/CommandV5.types.ts b/packages/lib-common/src/types/command/legacy/CommandV5.types.ts index a7244088e3..edb678d71f 100644 --- a/packages/lib-common/src/types/command/legacy/CommandV5.types.ts +++ b/packages/lib-common/src/types/command/legacy/CommandV5.types.ts @@ -1,5 +1,5 @@ -import type { PartialTargetDescriptorV5 } from "./PartialTargetDescriptorV5.types"; import type { ActionCommandV5 } from "./ActionCommandV5"; +import type { PartialTargetDescriptorV5 } from "./PartialTargetDescriptorV5.types"; export interface CommandV5 { /** diff --git a/packages/lib-common/src/util/serializedMarksToTokenHats.ts b/packages/lib-common/src/util/serializedMarksToTokenHats.ts index a3aa31b9d8..7701d6d95f 100644 --- a/packages/lib-common/src/util/serializedMarksToTokenHats.ts +++ b/packages/lib-common/src/util/serializedMarksToTokenHats.ts @@ -1,8 +1,8 @@ import { plainObjectToRange } from "../testUtil/fromPlainObject"; +import type { TokenHat } from "../types/HatTokenMap"; +import type { TextEditor } from "../types/TextEditor"; import { splitKey } from "./splitKey"; 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/lib-common/src/util/toPlainObject.ts b/packages/lib-common/src/util/toPlainObject.ts index 21e9b79641..87c545d9bf 100644 --- a/packages/lib-common/src/util/toPlainObject.ts +++ b/packages/lib-common/src/util/toPlainObject.ts @@ -1,12 +1,12 @@ +import type { FlashStyle } from "../ide/types/FlashDescriptor"; import type { CharacterRange, GeneralizedRange, LineRange, } from "../types/GeneralizedRange"; import { isLineRange } from "../types/GeneralizedRange"; -import type { FlashStyle } from "../ide/types/FlashDescriptor"; -import type { Token } from "../types/Token"; import type { Selection } from "../types/Selection"; +import type { Token } from "../types/Token"; export type PositionPlainObject = { line: number; diff --git a/packages/lib-engine/src/CommandHistory.ts b/packages/lib-engine/src/CommandHistory.ts index 0967d1d148..9f8e5171b7 100644 --- a/packages/lib-engine/src/CommandHistory.ts +++ b/packages/lib-engine/src/CommandHistory.ts @@ -1,3 +1,5 @@ +import { produce } from "immer"; +import { v4 as uuid } from "uuid"; import type { ActionDescriptor, CommandComplete, @@ -7,10 +9,8 @@ import type { IDE, ReadOnlyHatMap, } from "@cursorless/lib-common"; -import { produce } from "immer"; -import { v4 as uuid } from "uuid"; -import type { CommandRunner } from "./CommandRunner"; import type { CommandRunnerDecorator } from "./api/CursorlessEngineApi"; +import type { CommandRunner } from "./CommandRunner"; const filePrefix = "cursorlessCommandHistory"; diff --git a/packages/lib-engine/src/CommandHistoryAnalyzer.ts b/packages/lib-engine/src/CommandHistoryAnalyzer.ts index 1e3ab81243..479e65147b 100644 --- a/packages/lib-engine/src/CommandHistoryAnalyzer.ts +++ b/packages/lib-engine/src/CommandHistoryAnalyzer.ts @@ -1,3 +1,4 @@ +import { groupBy, map, sum } from "lodash-es"; import type { CommandHistoryEntry, CommandHistoryStorage, @@ -7,7 +8,6 @@ import type { ScopeType, } from "@cursorless/lib-common"; import { showWarning } from "@cursorless/lib-common"; -import { groupBy, map, sum } from "lodash-es"; import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import { getPartialTargetDescriptors } from "./util/getPartialTargetDescriptors"; import { getPartialPrimitiveTargets } from "./util/getPrimitiveTargets"; diff --git a/packages/lib-engine/src/actions/Actions.ts b/packages/lib-engine/src/actions/Actions.ts index 127ef27ce6..cef3592d6e 100644 --- a/packages/lib-engine/src/actions/Actions.ts +++ b/packages/lib-engine/src/actions/Actions.ts @@ -2,6 +2,7 @@ import type { IDE, TreeSitter } from "@cursorless/lib-common"; import type { Snippets } from "../core/Snippets"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; +import type { ActionRecord } from "./actions.types"; import { BreakLine } from "./BreakLine"; import { Bring, Move, Swap } from "./BringMoveSwap"; import Call from "./Call"; @@ -19,6 +20,7 @@ import GenerateSnippet from "./GenerateSnippet"; import GetTargets from "./GetTargets"; import GetText from "./GetText"; import Highlight from "./Highlight"; +import { Decrement, Increment } from "./incrementDecrement"; import { IndentLine, OutdentLine } from "./IndentLine"; import { CopyContentAfter as InsertCopyAfter, @@ -67,8 +69,6 @@ import { Random, Reverse, Sort } from "./Sort"; import ToggleBreakpoint from "./ToggleBreakpoint"; import Wrap from "./Wrap"; import WrapWithSnippet from "./WrapWithSnippet"; -import type { ActionRecord } from "./actions.types"; -import { Decrement, Increment } from "./incrementDecrement"; /** * Keeps a map from action names to objects that implement the given action diff --git a/packages/lib-engine/src/actions/BreakLine.ts b/packages/lib-engine/src/actions/BreakLine.ts index edfa62834a..b729260237 100644 --- a/packages/lib-engine/src/actions/BreakLine.ts +++ b/packages/lib-engine/src/actions/BreakLine.ts @@ -1,6 +1,6 @@ +import { flatten, zip } from "lodash-es"; import type { Edit, IDE, TextEditor } from "@cursorless/lib-common"; import { FlashStyle, Position, Range, Selection } from "@cursorless/lib-common"; -import { flatten, zip } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import type { Target } from "../typings/target.types"; diff --git a/packages/lib-engine/src/actions/BringMoveSwap.ts b/packages/lib-engine/src/actions/BringMoveSwap.ts index 74e3f01ecd..c5b2456e71 100644 --- a/packages/lib-engine/src/actions/BringMoveSwap.ts +++ b/packages/lib-engine/src/actions/BringMoveSwap.ts @@ -1,3 +1,4 @@ +import { flatten } from "lodash-es"; import type { GeneralizedRange, IDE, @@ -9,11 +10,10 @@ import { RangeExpansionBehavior, Selection, } from "@cursorless/lib-common"; -import { flatten } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import type { EditWithRangeUpdater } from "../typings/Types"; import type { Destination, Target } from "../typings/target.types"; +import type { EditWithRangeUpdater } from "../typings/Types"; import { flashTargets, runForEachEditor, diff --git a/packages/lib-engine/src/actions/CallbackAction.ts b/packages/lib-engine/src/actions/CallbackAction.ts index d5488f8b98..d729d058ca 100644 --- a/packages/lib-engine/src/actions/CallbackAction.ts +++ b/packages/lib-engine/src/actions/CallbackAction.ts @@ -1,10 +1,10 @@ +import { flatten } from "lodash-es"; import type { EditableTextEditor, IDE, TextEditor, } from "@cursorless/lib-common"; import { FlashStyle } from "@cursorless/lib-common"; -import { flatten } from "lodash-es"; import { selectionToStoredTarget } from "../core/commandRunner/selectionToStoredTarget"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; diff --git a/packages/lib-engine/src/actions/CopyToClipboard.ts b/packages/lib-engine/src/actions/CopyToClipboard.ts index c8bb0595d6..652024accf 100644 --- a/packages/lib-engine/src/actions/CopyToClipboard.ts +++ b/packages/lib-engine/src/actions/CopyToClipboard.ts @@ -1,11 +1,11 @@ import type { IDE } from "@cursorless/lib-common"; import { FlashStyle } from "@cursorless/lib-common"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; -import { CopyToClipboardSimple } from "./SimpleIdeCommandActions"; import type { Target } from "../typings/target.types"; import { flashTargets } from "../util/targetUtils"; import type { Actions } from "./Actions"; import type { ActionReturnValue, SimpleAction } from "./actions.types"; +import { CopyToClipboardSimple } from "./SimpleIdeCommandActions"; interface Options { showDecorations?: boolean; diff --git a/packages/lib-engine/src/actions/EditNew/runEditTargets.ts b/packages/lib-engine/src/actions/EditNew/runEditTargets.ts index 3625a20203..3bb3068fe0 100644 --- a/packages/lib-engine/src/actions/EditNew/runEditTargets.ts +++ b/packages/lib-engine/src/actions/EditNew/runEditTargets.ts @@ -1,6 +1,6 @@ +import { zip } from "lodash-es"; import type { EditableTextEditor } from "@cursorless/lib-common"; import { RangeExpansionBehavior } from "@cursorless/lib-common"; -import { zip } from "lodash-es"; import type { RangeUpdater } from "../../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../../core/updateSelections/updateSelections"; import type { EditDestination, State } from "./EditNew.types"; diff --git a/packages/lib-engine/src/actions/EditNewLineAction.ts b/packages/lib-engine/src/actions/EditNewLineAction.ts index d5c02f6f5a..f88dc15792 100644 --- a/packages/lib-engine/src/actions/EditNewLineAction.ts +++ b/packages/lib-engine/src/actions/EditNewLineAction.ts @@ -1,6 +1,6 @@ +import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import type { ModifierStage } from "../processTargets/PipelineStages.types"; -import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; import type { Target } from "../typings/target.types"; import type { ActionRecord, diff --git a/packages/lib-engine/src/actions/ExecuteCommand.ts b/packages/lib-engine/src/actions/ExecuteCommand.ts index 4133afe5fa..55b61f7025 100644 --- a/packages/lib-engine/src/actions/ExecuteCommand.ts +++ b/packages/lib-engine/src/actions/ExecuteCommand.ts @@ -1,8 +1,8 @@ import type { ExecuteCommandOptions, IDE } from "@cursorless/lib-common"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import type { Target } from "../typings/target.types"; -import { CallbackAction } from "./CallbackAction"; import type { ActionReturnValue } from "./actions.types"; +import { CallbackAction } from "./CallbackAction"; /** * This action can be used to execute a built-in ide command on one or more diff --git a/packages/lib-engine/src/actions/GenerateSnippet/editText.ts b/packages/lib-engine/src/actions/GenerateSnippet/editText.ts index 64678273ec..922b51dc23 100644 --- a/packages/lib-engine/src/actions/GenerateSnippet/editText.ts +++ b/packages/lib-engine/src/actions/GenerateSnippet/editText.ts @@ -1,5 +1,5 @@ -import type { Offsets } from "./Offsets"; import { sortBy } from "lodash-es"; +import type { Offsets } from "./Offsets"; /** * For each edit in {@link edits} replaces the given {@link Edit.offsets} in diff --git a/packages/lib-engine/src/actions/IndentLine.ts b/packages/lib-engine/src/actions/IndentLine.ts index feecc3ae21..cbabde2eff 100644 --- a/packages/lib-engine/src/actions/IndentLine.ts +++ b/packages/lib-engine/src/actions/IndentLine.ts @@ -1,16 +1,16 @@ +import { flatten, zip } from "lodash-es"; import type { IDE, TextEditor } from "@cursorless/lib-common"; import { FlashStyle, Range, Selection } from "@cursorless/lib-common"; -import { flatten, zip } from "lodash-es"; import { selectionToStoredTarget } from "../core/commandRunner/selectionToStoredTarget"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import type { Target } from "../typings/target.types"; import { flashTargets, runOnTargetsForEachEditor } from "../util/targetUtils"; +import type { ActionReturnValue } from "./actions.types"; import { IndentLineSimpleAction, OutdentLineSimpleAction, } from "./SimpleIdeCommandActions"; -import type { ActionReturnValue } from "./actions.types"; -import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; abstract class IndentLineBase { constructor( diff --git a/packages/lib-engine/src/actions/InsertCopy.ts b/packages/lib-engine/src/actions/InsertCopy.ts index b3c9acb154..cbbdacd114 100644 --- a/packages/lib-engine/src/actions/InsertCopy.ts +++ b/packages/lib-engine/src/actions/InsertCopy.ts @@ -1,14 +1,14 @@ +import { flatten, zip } from "lodash-es"; import type { IDE, TextEditor } from "@cursorless/lib-common"; import { FlashStyle, RangeExpansionBehavior, toCharacterRange, } from "@cursorless/lib-common"; -import { flatten, zip } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import type { Target } from "../typings/target.types"; import { createThatMark, runOnTargetsForEachEditor } from "../util/targetUtils"; import type { ActionReturnValue, SimpleAction } from "./actions.types"; diff --git a/packages/lib-engine/src/actions/InsertSnippet.ts b/packages/lib-engine/src/actions/InsertSnippet.ts index 0f47d31077..404a410747 100644 --- a/packages/lib-engine/src/actions/InsertSnippet.ts +++ b/packages/lib-engine/src/actions/InsertSnippet.ts @@ -6,9 +6,9 @@ import { import { getPreferredSnippet } from "../core/getPreferredSnippet"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; +import { ModifyIfUntypedExplicitStage } from "../processTargets/modifiers/ConditionalModifierStages"; import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import type { ModifierStage } from "../processTargets/PipelineStages.types"; -import { ModifyIfUntypedExplicitStage } from "../processTargets/modifiers/ConditionalModifierStages"; import { transformSnippetVariables } from "../snippets/transformSnippetVariables"; import { SnippetParser } from "../snippets/vendor/vscodeSnippet/snippetParser"; import type { Destination } from "../typings/target.types"; diff --git a/packages/lib-engine/src/actions/JoinLines.ts b/packages/lib-engine/src/actions/JoinLines.ts index 4fdd6d8d0b..2f89d84e7f 100644 --- a/packages/lib-engine/src/actions/JoinLines.ts +++ b/packages/lib-engine/src/actions/JoinLines.ts @@ -1,3 +1,5 @@ +import { range as iterRange, map, pairwise } from "itertools"; +import { flatten } from "lodash-es"; import type { Edit, IDE, TextEditor } from "@cursorless/lib-common"; import { FlashStyle, @@ -5,8 +7,6 @@ import { Selection, zipStrict, } from "@cursorless/lib-common"; -import { range as iterRange, map, pairwise } from "itertools"; -import { flatten } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; diff --git a/packages/lib-engine/src/actions/PasteFromClipboardDirectly.ts b/packages/lib-engine/src/actions/PasteFromClipboardDirectly.ts index 24bfb086d6..f3183df0c4 100644 --- a/packages/lib-engine/src/actions/PasteFromClipboardDirectly.ts +++ b/packages/lib-engine/src/actions/PasteFromClipboardDirectly.ts @@ -1,3 +1,4 @@ +import { flatten } from "lodash-es"; import type { IDE, TextEditor } from "@cursorless/lib-common"; import { FlashStyle, @@ -6,7 +7,6 @@ import { toCharacterRange, zipStrict, } from "@cursorless/lib-common"; -import { flatten } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import type { Destination } from "../typings/target.types"; diff --git a/packages/lib-engine/src/actions/Remove.ts b/packages/lib-engine/src/actions/Remove.ts index c65198482c..acf3a973e5 100644 --- a/packages/lib-engine/src/actions/Remove.ts +++ b/packages/lib-engine/src/actions/Remove.ts @@ -1,6 +1,6 @@ +import { flatten, zip } from "lodash-es"; import type { IDE, TextEditor } from "@cursorless/lib-common"; import { FlashStyle } from "@cursorless/lib-common"; -import { flatten, zip } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { RawSelectionTarget } from "../processTargets/targets"; diff --git a/packages/lib-engine/src/actions/Replace.ts b/packages/lib-engine/src/actions/Replace.ts index 67cad29f4d..228627dbee 100644 --- a/packages/lib-engine/src/actions/Replace.ts +++ b/packages/lib-engine/src/actions/Replace.ts @@ -1,14 +1,14 @@ +import { zip } from "lodash-es"; import type { IDE, ReplaceWith } from "@cursorless/lib-common"; import { FlashStyle, RangeExpansionBehavior, Selection, } from "@cursorless/lib-common"; -import { zip } from "lodash-es"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import type { SelectionWithEditor } from "../typings/Types"; import type { Destination, Target } from "../typings/target.types"; +import type { SelectionWithEditor } from "../typings/Types"; import { flashTargets, runForEachEditor } from "../util/targetUtils"; import type { ActionReturnValue } from "./actions.types"; diff --git a/packages/lib-engine/src/actions/ShowParseTree.ts b/packages/lib-engine/src/actions/ShowParseTree.ts index 3ab71dc112..5d9998dc59 100644 --- a/packages/lib-engine/src/actions/ShowParseTree.ts +++ b/packages/lib-engine/src/actions/ShowParseTree.ts @@ -1,6 +1,6 @@ +import type { Tree, TreeCursor } from "web-tree-sitter"; import type { IDE, TextDocument, TreeSitter } from "@cursorless/lib-common"; import { FlashStyle, Range } from "@cursorless/lib-common"; -import type { Tree, TreeCursor } from "web-tree-sitter"; import type { Target } from "../typings/target.types"; import { flashTargets } from "../util/targetUtils"; import type { ActionReturnValue } from "./actions.types"; diff --git a/packages/lib-engine/src/actions/SimpleIdeCommandActions.ts b/packages/lib-engine/src/actions/SimpleIdeCommandActions.ts index fa5a7d2c64..43eba58571 100644 --- a/packages/lib-engine/src/actions/SimpleIdeCommandActions.ts +++ b/packages/lib-engine/src/actions/SimpleIdeCommandActions.ts @@ -6,8 +6,8 @@ import type { } from "@cursorless/lib-common"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import type { Target } from "../typings/target.types"; -import { CallbackAction } from "./CallbackAction"; import type { ActionReturnValue } from "./actions.types"; +import { CallbackAction } from "./CallbackAction"; interface Options { showDecorations?: boolean; diff --git a/packages/lib-engine/src/actions/Sort.ts b/packages/lib-engine/src/actions/Sort.ts index 2e3ac83370..63285222eb 100644 --- a/packages/lib-engine/src/actions/Sort.ts +++ b/packages/lib-engine/src/actions/Sort.ts @@ -1,5 +1,5 @@ -import { showWarning, type IDE } from "@cursorless/lib-common"; import { shuffle } from "lodash-es"; +import { showWarning, type IDE } from "@cursorless/lib-common"; import type { Target } from "../typings/target.types"; import type { Actions } from "./Actions"; import type { ActionReturnValue, SimpleAction } from "./actions.types"; diff --git a/packages/lib-engine/src/actions/ToggleBreakpoint.ts b/packages/lib-engine/src/actions/ToggleBreakpoint.ts index 100f9b8128..7e585f4fed 100644 --- a/packages/lib-engine/src/actions/ToggleBreakpoint.ts +++ b/packages/lib-engine/src/actions/ToggleBreakpoint.ts @@ -1,6 +1,6 @@ import { FlashStyle, type IDE } from "@cursorless/lib-common"; -import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { containingLineIfUntypedModifier } from "../processTargets/modifiers/commonContainingScopeIfUntypedModifiers"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import type { Target } from "../typings/target.types"; import { flashTargets, diff --git a/packages/lib-engine/src/actions/WrapWithSnippet.ts b/packages/lib-engine/src/actions/WrapWithSnippet.ts index 9d8a062307..b8c0c4bb27 100644 --- a/packages/lib-engine/src/actions/WrapWithSnippet.ts +++ b/packages/lib-engine/src/actions/WrapWithSnippet.ts @@ -3,9 +3,9 @@ import { FlashStyle } from "@cursorless/lib-common"; import { getPreferredSnippet } from "../core/getPreferredSnippet"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; +import { ModifyIfUntypedStage } from "../processTargets/modifiers/ConditionalModifierStages"; import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import type { ModifierStage } from "../processTargets/PipelineStages.types"; -import { ModifyIfUntypedStage } from "../processTargets/modifiers/ConditionalModifierStages"; import { transformSnippetVariables } from "../snippets/transformSnippetVariables"; import { SnippetParser } from "../snippets/vendor/vscodeSnippet/snippetParser"; import type { Target } from "../typings/target.types"; diff --git a/packages/lib-engine/src/actions/actions.types.ts b/packages/lib-engine/src/actions/actions.types.ts index 28086b3e13..2339da2f73 100644 --- a/packages/lib-engine/src/actions/actions.types.ts +++ b/packages/lib-engine/src/actions/actions.types.ts @@ -8,8 +8,8 @@ import type { WrapWithSnippetArg, } from "@cursorless/lib-common"; import type { ModifierStage } from "../processTargets/PipelineStages.types"; -import type { SelectionWithEditor } from "../typings/Types"; import type { Destination, Target } from "../typings/target.types"; +import type { SelectionWithEditor } from "../typings/Types"; /** * To be returned by {@link SimpleAction.run} diff --git a/packages/lib-engine/src/actions/incrementDecrement.ts b/packages/lib-engine/src/actions/incrementDecrement.ts index efb2f0343e..3cc6b2e832 100644 --- a/packages/lib-engine/src/actions/incrementDecrement.ts +++ b/packages/lib-engine/src/actions/incrementDecrement.ts @@ -1,8 +1,8 @@ import type { MatchedText, TextEditor } from "@cursorless/lib-common"; import { Range, matchText } from "@cursorless/lib-common"; import { PlainTarget } from "../processTargets/targets"; -import type { SelectionWithEditor } from "../typings/Types"; import type { Destination, Target } from "../typings/target.types"; +import type { SelectionWithEditor } from "../typings/Types"; import { runForEachEditor } from "../util/targetUtils"; import type { Actions } from "./Actions"; import type { ActionReturnValue } from "./actions.types"; diff --git a/packages/lib-engine/src/core/HatAllocator.ts b/packages/lib-engine/src/core/HatAllocator.ts index 5dcfad5c52..ce8f71dcc8 100644 --- a/packages/lib-engine/src/core/HatAllocator.ts +++ b/packages/lib-engine/src/core/HatAllocator.ts @@ -1,8 +1,8 @@ import type { Disposable, Hats, IDE, TokenHat } from "@cursorless/lib-common"; import type { TokenGraphemeSplitter } from "../tokenGraphemeSplitter"; import { allocateHats } from "../util/allocateHats"; -import type { IndividualHatMap } from "./IndividualHatMap"; import { DecorationDebouncer } from "../util/DecorationDebouncer"; +import type { IndividualHatMap } from "./IndividualHatMap"; interface Context { getActiveMap(): Promise; diff --git a/packages/lib-engine/src/core/commandRunner/CommandRunnerImpl.ts b/packages/lib-engine/src/core/commandRunner/CommandRunnerImpl.ts index c943e10060..48867ab603 100644 --- a/packages/lib-engine/src/core/commandRunner/CommandRunnerImpl.ts +++ b/packages/lib-engine/src/core/commandRunner/CommandRunnerImpl.ts @@ -7,17 +7,17 @@ import type { PartialTargetDescriptor, } from "@cursorless/lib-common"; import { clientSupportsFallback } from "@cursorless/lib-common"; -import type { CommandRunner } from "../../CommandRunner"; import type { ActionRecord, ActionReturnValue, } from "../../actions/actions.types"; +import type { CommandRunner } from "../../CommandRunner"; import { parseAndFillOutAction } from "../../customCommandGrammar/parseAndFillOutAction"; 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 { SelectionWithEditor } from "../../typings/Types"; import type { Debug } from "../Debug"; import { getCommandFallback } from "../getCommandFallback"; import { inferFullTargetDescriptor } from "../inferFullTargetDescriptor"; diff --git a/packages/lib-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts b/packages/lib-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts index 88e86ecde7..24a0e8ff20 100644 --- a/packages/lib-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts +++ b/packages/lib-engine/src/core/commandVersionUpgrades/canonicalizeAndValidateCommand.ts @@ -1,3 +1,4 @@ +import { produce } from "immer"; import type { ActionType, Command, @@ -7,7 +8,6 @@ import type { PartialTargetDescriptor, } from "@cursorless/lib-common"; import { LATEST_VERSION, OutdatedExtensionError } from "@cursorless/lib-common"; -import { produce } from "immer"; import { getPartialTargetDescriptors } from "../../util/getPartialTargetDescriptors"; import canonicalizeTargetsInPlace from "./canonicalizeTargetsInPlace"; import { upgradeV0ToV1 } from "./upgradeV0ToV1"; diff --git a/packages/lib-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts b/packages/lib-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts index ab809edfb7..4a86a8b6e4 100644 --- a/packages/lib-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts +++ b/packages/lib-engine/src/core/commandVersionUpgrades/upgradeV2ToV3/upgradeV2ToV3.ts @@ -1,3 +1,4 @@ +import { isEqual } from "lodash-es"; import type { CommandV2, CommandV3, @@ -19,7 +20,6 @@ import type { RangeModifierV3, ScopeTypeV2, } from "@cursorless/lib-common"; -import { isEqual } from "lodash-es"; export function upgradeV2ToV3(command: CommandV2): CommandV3 { return { diff --git a/packages/lib-engine/src/core/getPreferredSnippet.test.ts b/packages/lib-engine/src/core/getPreferredSnippet.test.ts index 0418f780c8..8927d597fa 100644 --- a/packages/lib-engine/src/core/getPreferredSnippet.test.ts +++ b/packages/lib-engine/src/core/getPreferredSnippet.test.ts @@ -1,3 +1,4 @@ +import * as assert from "node:assert/strict"; import type { CustomInsertSnippetArg, CustomWrapWithSnippetArg, @@ -5,7 +6,6 @@ import type { ListInsertSnippetArg, ListWrapWithSnippetArg, } from "@cursorless/lib-common"; -import * as assert from "node:assert/strict"; import { getPreferredSnippet } from "./getPreferredSnippet"; const deprecatedNamed: DeprecatedNamedSnippetArg = { diff --git a/packages/lib-engine/src/core/handleHoistedModifiers.ts b/packages/lib-engine/src/core/handleHoistedModifiers.ts index c11aa0af4f..e589f01f02 100644 --- a/packages/lib-engine/src/core/handleHoistedModifiers.ts +++ b/packages/lib-engine/src/core/handleHoistedModifiers.ts @@ -1,10 +1,10 @@ -import type { Modifier } from "@cursorless/lib-common"; +import { produce } from "immer"; import { findLastIndex } from "lodash-es"; +import type { Modifier } from "@cursorless/lib-common"; import type { PrimitiveTargetDescriptor, RangeTargetDescriptor, } from "../typings/TargetDescriptor"; -import { produce } from "immer"; /** * This function exists to enable hoisted modifiers, eg for constructs like diff --git a/packages/lib-engine/src/core/updateSelections/RangeUpdater.ts b/packages/lib-engine/src/core/updateSelections/RangeUpdater.ts index 7efbf4cb9b..b12766c41c 100644 --- a/packages/lib-engine/src/core/updateSelections/RangeUpdater.ts +++ b/packages/lib-engine/src/core/updateSelections/RangeUpdater.ts @@ -1,3 +1,4 @@ +import { pull } from "lodash-es"; import type { Disposable, Edit, @@ -6,7 +7,6 @@ import type { TextDocumentChangeEvent, TextDocumentContentChangeEvent, } from "@cursorless/lib-common"; -import { pull } from "lodash-es"; import type { ExtendedTextDocumentChangeEvent, FullRangeInfo, diff --git a/packages/lib-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/packages/lib-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts index 042d5d1571..cc99b3dfec 100644 --- a/packages/lib-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts +++ b/packages/lib-engine/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -1,9 +1,9 @@ import { invariant } from "immutability-helper"; +import type { RangeOffsets } from "@cursorless/lib-common"; import type { ChangeEventInfo, FullRangeInfo, } from "../../typings/updateSelections"; -import type { RangeOffsets } from "@cursorless/lib-common"; /** * Gets updated offsets for the range `rangeInfo` after the change described by diff --git a/packages/lib-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts b/packages/lib-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts index 3feaf54c7b..43b11df4af 100644 --- a/packages/lib-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts +++ b/packages/lib-engine/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts @@ -1,6 +1,6 @@ +import { invariant } from "immutability-helper"; import type { RangeOffsets } from "@cursorless/lib-common"; import { leftAnchored, rightAnchored } from "@cursorless/lib-common"; -import { invariant } from "immutability-helper"; import type { ChangeEventInfo, FullRangeInfo, diff --git a/packages/lib-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts b/packages/lib-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts index a5ff3e32b8..d8ddfa96ae 100644 --- a/packages/lib-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts +++ b/packages/lib-engine/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts @@ -1,6 +1,6 @@ +import { invariant } from "immutability-helper"; import type { RangeOffsets } from "@cursorless/lib-common"; import { leftAnchored, rightAnchored } from "@cursorless/lib-common"; -import { invariant } from "immutability-helper"; import type { ChangeEventInfo, FullRangeInfo, diff --git a/packages/lib-engine/src/core/updateSelections/getUpdatedText.ts b/packages/lib-engine/src/core/updateSelections/getUpdatedText.ts index 1cd9fddee6..fd3f87775f 100644 --- a/packages/lib-engine/src/core/updateSelections/getUpdatedText.ts +++ b/packages/lib-engine/src/core/updateSelections/getUpdatedText.ts @@ -1,8 +1,8 @@ +import type { RangeOffsets } from "@cursorless/lib-common"; import type { ChangeEventInfo, FullRangeInfo, } from "../../typings/updateSelections"; -import type { RangeOffsets } from "@cursorless/lib-common"; /** * Updates the text of the given rangeInfo to take into account the given change. diff --git a/packages/lib-engine/src/core/updateSelections/updateRangeInfos.ts b/packages/lib-engine/src/core/updateSelections/updateRangeInfos.ts index d092e097b0..7952b20e17 100644 --- a/packages/lib-engine/src/core/updateSelections/updateRangeInfos.ts +++ b/packages/lib-engine/src/core/updateSelections/updateRangeInfos.ts @@ -1,13 +1,13 @@ import { sumBy } from "lodash-es"; -import getOffsetsForDeleteOrReplace from "./getOffsetsForDeleteOrReplace"; -import getOffsetsForEmptyRangeInsert from "./getOffsetsForEmptyRangeInsert"; -import getOffsetsForNonEmptyRangeInsert from "./getOffsetsForNonEmptyRangeInsert"; +import type { RangeOffsets } from "@cursorless/lib-common"; import type { ExtendedTextDocumentChangeEvent, FullRangeInfo, ChangeEventInfo, } from "../../typings/updateSelections"; -import type { RangeOffsets } from "@cursorless/lib-common"; +import getOffsetsForDeleteOrReplace from "./getOffsetsForDeleteOrReplace"; +import getOffsetsForEmptyRangeInsert from "./getOffsetsForEmptyRangeInsert"; +import getOffsetsForNonEmptyRangeInsert from "./getOffsetsForNonEmptyRangeInsert"; import { getUpdatedText } from "./getUpdatedText"; /** diff --git a/packages/lib-engine/src/core/updateSelections/updateSelections.ts b/packages/lib-engine/src/core/updateSelections/updateSelections.ts index 9198d8c52b..cae410b277 100644 --- a/packages/lib-engine/src/core/updateSelections/updateSelections.ts +++ b/packages/lib-engine/src/core/updateSelections/updateSelections.ts @@ -1,3 +1,4 @@ +import { flatten } from "lodash-es"; import type { Edit, EditableTextEditor, @@ -9,7 +10,6 @@ import { Selection, unsafeKeys, } from "@cursorless/lib-common"; -import { flatten } from "lodash-es"; import type { FullSelectionInfo, SelectionInfo, diff --git a/packages/lib-engine/src/cursorlessEngine.ts b/packages/lib-engine/src/cursorlessEngine.ts index 2ac3a5ad69..086965e09c 100644 --- a/packages/lib-engine/src/cursorlessEngine.ts +++ b/packages/lib-engine/src/cursorlessEngine.ts @@ -9,7 +9,6 @@ import type { TreeSitter, } from "@cursorless/lib-common"; import { ensureCommandShape, PassthroughIDE } from "@cursorless/lib-common"; -import { KeyboardTargetUpdater } from "./KeyboardTargetUpdater"; import type { CommandRunnerDecorator, CursorlessEngine, @@ -26,10 +25,11 @@ import { DisabledSnippets } from "./disabledComponents/DisabledSnippets"; import { DisabledTalonSpokenForms } from "./disabledComponents/DisabledTalonSpokenForms"; import { DisabledTreeSitter } from "./disabledComponents/DisabledTreeSitter"; import { CustomSpokenFormGeneratorImpl } from "./generateSpokenForm/CustomSpokenFormGeneratorImpl"; +import { KeyboardTargetUpdater } from "./KeyboardTargetUpdater"; import type { LanguageDefinitions } from "./languages/LanguageDefinitions"; import { LanguageDefinitionsImpl } from "./languages/LanguageDefinitions"; -import { ModifierStageFactoryImpl } from "./processTargets/ModifierStageFactoryImpl"; import { ScopeHandlerFactoryImpl } from "./processTargets/modifiers/scopeHandlers"; +import { ModifierStageFactoryImpl } from "./processTargets/ModifierStageFactoryImpl"; import { runCommand } from "./runCommand"; import { ScopeInfoProvider } from "./scopeProviders/ScopeInfoProvider"; import { ScopeRangeProvider } from "./scopeProviders/ScopeRangeProvider"; diff --git a/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts b/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts index 77ebdafce4..dcec77a11e 100644 --- a/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts +++ b/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts @@ -1,5 +1,5 @@ -import { type ActionDescriptor } from "@cursorless/lib-common"; import * as assert from "node:assert/strict"; +import { type ActionDescriptor } from "@cursorless/lib-common"; import { parseAction } from "./parseCommand"; import type { WithPlaceholders } from "./WithPlaceholders"; diff --git a/packages/lib-engine/src/customCommandGrammar/lexer.ts b/packages/lib-engine/src/customCommandGrammar/lexer.ts index bc85e2dbed..8b54c63746 100644 --- a/packages/lib-engine/src/customCommandGrammar/lexer.ts +++ b/packages/lib-engine/src/customCommandGrammar/lexer.ts @@ -7,9 +7,9 @@ import { simpleScopeTypeTypes, surroundingPairNames, } from "@cursorless/lib-common"; +import { connectives } from "../generateSpokenForm/defaultSpokenForms/connectives"; import { marks } from "../generateSpokenForm/defaultSpokenForms/marks"; import { defaultSpokenFormMap } from "../spokenForms/defaultSpokenFormMap"; -import { connectives } from "../generateSpokenForm/defaultSpokenForms/connectives"; import { CommandLexer } from "./CommandLexer"; interface Token { diff --git a/packages/lib-engine/src/customCommandGrammar/parseCommand.ts b/packages/lib-engine/src/customCommandGrammar/parseCommand.ts index 95decc7d1b..5e38e558a2 100644 --- a/packages/lib-engine/src/customCommandGrammar/parseCommand.ts +++ b/packages/lib-engine/src/customCommandGrammar/parseCommand.ts @@ -1,7 +1,7 @@ -import type { ActionDescriptor, ScopeType } from "@cursorless/lib-common"; import nearley from "nearley"; -import type { WithPlaceholders } from "./WithPlaceholders"; +import type { ActionDescriptor, ScopeType } from "@cursorless/lib-common"; import grammar from "./generated/grammar"; +import type { WithPlaceholders } from "./WithPlaceholders"; function getScopeTypeParser(): nearley.Parser { return new nearley.Parser( diff --git a/packages/lib-engine/src/disabledComponents/DisabledTreeSitter.ts b/packages/lib-engine/src/disabledComponents/DisabledTreeSitter.ts index 2b6d027d0d..db94bdc091 100644 --- a/packages/lib-engine/src/disabledComponents/DisabledTreeSitter.ts +++ b/packages/lib-engine/src/disabledComponents/DisabledTreeSitter.ts @@ -1,5 +1,5 @@ -import type { TextDocument, TreeSitter } from "@cursorless/lib-common"; import type { Query, Tree } from "web-tree-sitter"; +import type { TextDocument, TreeSitter } from "@cursorless/lib-common"; export class DisabledTreeSitter implements TreeSitter { loadLanguage(_languageId: string): Promise { diff --git a/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts b/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts index ef1f858009..5bcc2ed5f2 100644 --- a/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts +++ b/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts @@ -1,6 +1,6 @@ import * as assert from "node:assert/strict"; -import { CustomSpokenFormGeneratorImpl } from "./CustomSpokenFormGeneratorImpl"; import { FakeIDE, LATEST_VERSION, asyncSafety } from "@cursorless/lib-common"; +import { CustomSpokenFormGeneratorImpl } from "./CustomSpokenFormGeneratorImpl"; suite("CustomSpokenFormGeneratorImpl", async function () { test( diff --git a/packages/lib-engine/src/generateSpokenForm/SpokenFormComponent.ts b/packages/lib-engine/src/generateSpokenForm/SpokenFormComponent.ts index 1517484d8e..7bc8ba6002 100644 --- a/packages/lib-engine/src/generateSpokenForm/SpokenFormComponent.ts +++ b/packages/lib-engine/src/generateSpokenForm/SpokenFormComponent.ts @@ -1,8 +1,8 @@ -import type { SpokenFormMapEntry } from "../spokenForms/SpokenFormMap"; import type { SpokenFormMapKeyTypes, SpokenFormType, } from "@cursorless/lib-common"; +import type { SpokenFormMapEntry } from "../spokenForms/SpokenFormMap"; /** * A component of a spoken form used internally during spoken form generation. diff --git a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts index a27377d4d2..345399f055 100644 --- a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts +++ b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts @@ -1,17 +1,17 @@ +import * as assert from "node:assert/strict"; +import { promises as fsp } from "node:fs"; +import * as yaml from "js-yaml"; import type { TestCaseFixtureLegacy } from "@cursorless/lib-common"; import { serializeTestFixture, shouldUpdateFixtures, } from "@cursorless/lib-common"; import { getRecordedTestPaths } from "@cursorless/lib-node-common"; -import * as yaml from "js-yaml"; -import * as assert from "node:assert/strict"; -import { promises as fsp } from "node:fs"; import { SpokenFormGenerator } from "."; import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; +import { defaultSpokenFormInfoMap } from "../spokenForms/defaultSpokenFormMap"; import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; import { mapSpokenForms } from "../spokenForms/SpokenFormMap"; -import { defaultSpokenFormInfoMap } from "../spokenForms/defaultSpokenFormMap"; import { getHatMapCommand } from "./getHatMapCommand"; /** diff --git a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts index b1a8e9526c..d828c60d87 100644 --- a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts +++ b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts @@ -11,8 +11,6 @@ import type { } from "@cursorless/lib-common"; import { camelCaseToAllDown, DOCS_URL } from "@cursorless/lib-common"; import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; -import { NoSpokenFormError } from "./NoSpokenFormError"; -import type { SpokenFormComponent } from "./SpokenFormComponent"; import { connectives } from "./defaultSpokenForms/connectives"; import { surroundingPairDelimitersToSpokenForm } from "./defaultSpokenForms/modifiers"; import { @@ -22,7 +20,9 @@ import { import { getRangeConnective } from "./getRangeConnective"; import type { SpokenFormComponentMap } from "./getSpokenFormComponentMap"; import { getSpokenFormComponentMap } from "./getSpokenFormComponentMap"; +import { NoSpokenFormError } from "./NoSpokenFormError"; import { PrimitiveTargetSpokenFormGenerator } from "./primitiveTargetToSpokenForm"; +import type { SpokenFormComponent } from "./SpokenFormComponent"; export class SpokenFormGenerator { private primitiveGenerator: PrimitiveTargetSpokenFormGenerator; diff --git a/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts b/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts index 1b3764261b..077973d8f7 100644 --- a/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts +++ b/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts @@ -1,6 +1,6 @@ import type { PartialRangeType } from "@cursorless/lib-common"; -import { NoSpokenFormError } from "./NoSpokenFormError"; import { connectives } from "./defaultSpokenForms/connectives"; +import { NoSpokenFormError } from "./NoSpokenFormError"; export function getRangeConnective( excludeAnchor: boolean, diff --git a/packages/lib-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts b/packages/lib-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts index d13658264a..a78e9b4c17 100644 --- a/packages/lib-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts +++ b/packages/lib-engine/src/generateSpokenForm/getSpokenFormComponentMap.ts @@ -1,9 +1,9 @@ -import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; import type { PartialSpokenFormTypes, SpokenFormMapKeyTypes, SpokenFormType, } from "@cursorless/lib-common"; +import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; import type { CustomizableSpokenFormComponentForType } from "./SpokenFormComponent"; /** diff --git a/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts b/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts index 6a166a0db0..ac468edbd4 100644 --- a/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts +++ b/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts @@ -6,7 +6,6 @@ import type { RelativeScopeModifier, ScopeType, } from "@cursorless/lib-common"; -import { NoSpokenFormError } from "./NoSpokenFormError"; import { connectives } from "./defaultSpokenForms/connectives"; import { hatColorToSpokenForm, @@ -14,13 +13,13 @@ import { lineDirections, marks, } from "./defaultSpokenForms/marks"; - -import { getRangeConnective } from "./getRangeConnective"; import { numberToSpokenForm, ordinalToSpokenForm, } from "./defaultSpokenForms/numbers"; +import { getRangeConnective } from "./getRangeConnective"; import type { SpokenFormComponentMap } from "./getSpokenFormComponentMap"; +import { NoSpokenFormError } from "./NoSpokenFormError"; import type { SpokenFormComponent } from "./SpokenFormComponent"; export class PrimitiveTargetSpokenFormGenerator { diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/QueryCapture.ts b/packages/lib-engine/src/languages/TreeSitterQuery/QueryCapture.ts index f300792221..fe06f5782c 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/QueryCapture.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/QueryCapture.ts @@ -1,5 +1,5 @@ -import type { Range, TextDocument } from "@cursorless/lib-common"; import type { Node } from "web-tree-sitter"; +import type { Range, TextDocument } from "@cursorless/lib-common"; /** * A capture of a query pattern against a syntax tree. Often corresponds to a diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts b/packages/lib-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts index f3c876ee6c..5ec3bb09df 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/QueryPredicateOperator.ts @@ -1,12 +1,12 @@ import type { PredicateStep } from "web-tree-sitter"; import type { z } from "zod"; +import { constructZodErrorMessages } from "./constructZodErrorMessages"; import type { AcceptFunctionArgs, HasSchema, InferSchemaType, } from "./PredicateOperatorSchemaTypes"; import type { MutableQueryMatch } from "./QueryCapture"; -import { constructZodErrorMessages } from "./constructZodErrorMessages"; /** * An operator used in a query predicate, e.g. `not-type?`. Note that the generic diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts b/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts index 57318bc938..2a3a09bd03 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQuery.ts @@ -1,3 +1,4 @@ +import type * as treeSitter from "web-tree-sitter"; import type { IDE, Mutable, @@ -5,7 +6,6 @@ import type { TextDocument, TreeSitter, } from "@cursorless/lib-common"; -import type * as treeSitter from "web-tree-sitter"; import type { ScopeCaptureName } from "./captureNames"; import { getNormalizedCaptureIndex, diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQueryCache.ts b/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQueryCache.ts index 2e6a3023c1..b829497944 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQueryCache.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/TreeSitterQueryCache.ts @@ -1,6 +1,6 @@ import type { Position, TextDocument } from "@cursorless/lib-common"; -import type { QueryMatch } from "./QueryCapture"; import { setIsEqual } from "../../util/setIsEqual"; +import type { QueryMatch } from "./QueryCapture"; export class TreeSitterQueryCache { private documentVersion: number = -1; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts index 22f5f0664e..7845c54219 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts @@ -1,8 +1,8 @@ +import * as assert from "node:assert/strict"; import type { Messages } from "@cursorless/lib-common"; import { Range } from "@cursorless/lib-common"; -import type { QueryCapture } from "./QueryCapture"; import { checkCaptureStartEnd } from "./checkCaptureStartEnd"; -import * as assert from "node:assert/strict"; +import type { QueryCapture } from "./QueryCapture"; interface TestCase { name: string; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/getNodeRange.ts b/packages/lib-engine/src/languages/TreeSitterQuery/getNodeRange.ts index 3e5d94ee56..3fef3c3ede 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/getNodeRange.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/getNodeRange.ts @@ -1,5 +1,5 @@ -import { Range } from "@cursorless/lib-common"; import type { Node } from "web-tree-sitter"; +import { Range } from "@cursorless/lib-common"; export function getNodeRange(node: Node) { return new Range( diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/makeRangeFromPositions.ts b/packages/lib-engine/src/languages/TreeSitterQuery/makeRangeFromPositions.ts index 1aae976ce5..2c0d6172b8 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/makeRangeFromPositions.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/makeRangeFromPositions.ts @@ -1,5 +1,5 @@ -import { Range } from "@cursorless/lib-common"; import type { Point } from "web-tree-sitter"; +import { Range } from "@cursorless/lib-common"; export function makeRangeFromPositions( startPosition: Point, diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts b/packages/lib-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts index cf8ede298c..5388df7724 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/operatorArgumentSchemaTypes.ts @@ -1,7 +1,7 @@ -import { z } from "zod"; -import { assertTypesEqual } from "./assertTypesEqual"; import type { PredicateStep } from "web-tree-sitter"; +import { z } from "zod"; import { stringToInteger } from "@cursorless/lib-common"; +import { assertTypesEqual } from "./assertTypesEqual"; const string = z.object({ type: z.literal("string"), value: z.string() }); diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts index bc783b7fbe..84b24ec12e 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts @@ -1,6 +1,6 @@ import * as assert from "node:assert/strict"; -import { parsePredicates } from "./parsePredicates"; import type { QueryPredicate } from "web-tree-sitter"; +import { parsePredicates } from "./parsePredicates"; const predicates: QueryPredicate[][] = [ [ diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicatesWithErrorHandling.ts b/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicatesWithErrorHandling.ts index a5282f0e28..4f62dbbc6f 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicatesWithErrorHandling.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicatesWithErrorHandling.ts @@ -1,6 +1,6 @@ +import type { Query } from "web-tree-sitter"; import type { IDE } from "@cursorless/lib-common"; import { showError } from "@cursorless/lib-common"; -import type { Query } from "web-tree-sitter"; import { parsePredicates } from "./parsePredicates"; import { predicateToString } from "./predicateToString"; import type { PatternPredicate } from "./QueryCapture"; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/positionToPoint.ts b/packages/lib-engine/src/languages/TreeSitterQuery/positionToPoint.ts index 4d7c9975f0..3476cb640d 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/positionToPoint.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/positionToPoint.ts @@ -1,5 +1,5 @@ -import type { Position } from "@cursorless/lib-common"; import type { Point } from "web-tree-sitter"; +import type { Position } from "@cursorless/lib-common"; export function positionToPoint(start: Position): Point { return { row: start.line, column: start.character }; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts b/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts index 2f964b6aa9..17d5874564 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts @@ -1,6 +1,6 @@ -import { Position, Range, adjustPosition } from "@cursorless/lib-common"; import type { Point } from "web-tree-sitter"; import { z } from "zod"; +import { Position, Range, adjustPosition } from "@cursorless/lib-common"; import { getNode } from "./getNode"; import { isEven } from "./isEven"; import { makeRangeFromPositions } from "./makeRangeFromPositions"; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts index 3a6d81ded1..67074184bd 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts @@ -1,5 +1,5 @@ -import { Range } from "@cursorless/lib-common"; import * as assert from "node:assert/strict"; +import { Range } from "@cursorless/lib-common"; import type { MutableQueryCapture, QueryCapture } from "./QueryCapture"; import { createTestQueryCapture, diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts b/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts index 8fc9aab47f..266b5cb27d 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.ts @@ -1,11 +1,11 @@ -import type { Range } from "@cursorless/lib-common"; import type { Node } from "web-tree-sitter"; -import type { QueryCapture } from "./QueryCapture"; +import type { Range } from "@cursorless/lib-common"; import { getNodeEndRange, getNodeRange, getNodeStartRange, } from "./getNodeRange"; +import type { QueryCapture } from "./QueryCapture"; const START_OF = ".startOf"; const END_OF = ".endOf"; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts index 4581e3dddb..462eab1b12 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts @@ -1,5 +1,5 @@ -import { FakeIDE } from "@cursorless/lib-common"; import * as assert from "node:assert/strict"; +import { FakeIDE } from "@cursorless/lib-common"; import { validateQueryCaptures } from "./validateQueryCaptures"; const testCases: { name: string; isOk: boolean; content: string }[] = [ diff --git a/packages/lib-engine/src/processTargets/MarkStageFactoryImpl.ts b/packages/lib-engine/src/processTargets/MarkStageFactoryImpl.ts index 83bc0fca78..2af1e56efc 100644 --- a/packages/lib-engine/src/processTargets/MarkStageFactoryImpl.ts +++ b/packages/lib-engine/src/processTargets/MarkStageFactoryImpl.ts @@ -2,8 +2,6 @@ import type { IDE, ReadOnlyHatMap } from "@cursorless/lib-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"; @@ -12,6 +10,8 @@ import { NothingStage } from "./marks/NothingStage"; import { RangeMarkStage } from "./marks/RangeMarkStage"; import { StoredTargetStage } from "./marks/StoredTargetStage"; import { TargetMarkStage } from "./marks/TargetMarkStage"; +import type { MarkStageFactory } from "./MarkStageFactory"; +import type { MarkStage } from "./PipelineStages.types"; export class MarkStageFactoryImpl implements MarkStageFactory { private targetPipelineRunner!: TargetPipelineRunner; diff --git a/packages/lib-engine/src/processTargets/ModifierStageFactory.ts b/packages/lib-engine/src/processTargets/ModifierStageFactory.ts index b0a3c22d65..7aa49e9724 100644 --- a/packages/lib-engine/src/processTargets/ModifierStageFactory.ts +++ b/packages/lib-engine/src/processTargets/ModifierStageFactory.ts @@ -1,6 +1,6 @@ import type { Modifier } from "@cursorless/lib-common"; -import type { ModifierStage } from "./PipelineStages.types"; import type { ComplexModifier } from "./modifiers/modifier.types"; +import type { ModifierStage } from "./PipelineStages.types"; export interface ModifierStageFactory { create(modifier: Modifier | ComplexModifier): ModifierStage; diff --git a/packages/lib-engine/src/processTargets/ModifierStageFactoryImpl.ts b/packages/lib-engine/src/processTargets/ModifierStageFactoryImpl.ts index 65e62581f9..5c039d32c2 100644 --- a/packages/lib-engine/src/processTargets/ModifierStageFactoryImpl.ts +++ b/packages/lib-engine/src/processTargets/ModifierStageFactoryImpl.ts @@ -1,8 +1,6 @@ import type { Modifier } from "@cursorless/lib-common"; import type { StoredTargetMap } from "../core/StoredTargets"; import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; -import type { ModifierStageFactory } from "./ModifierStageFactory"; -import type { ModifierStage } from "./PipelineStages.types"; import { ExcludeInteriorStage } from "./modifiers/BoundaryStage"; import { ClassFunctionNameStage } from "./modifiers/ClassFunctionNameStage"; import { ModifyIfUntypedStage } from "./modifiers/ConditionalModifierStages"; @@ -17,15 +15,17 @@ import { HeadStage, TailStage } from "./modifiers/HeadTailStage"; import { InstanceStage } from "./modifiers/InstanceStage"; import { InteriorOnlyStage } from "./modifiers/InteriorStage"; import { LeadingStage, TrailingStage } from "./modifiers/LeadingTrailingStages"; +import type { ComplexModifier } from "./modifiers/modifier.types"; import { OrdinalScopeStage } from "./modifiers/OrdinalScopeStage"; import { EndOfStage, StartOfStage } from "./modifiers/PositionStage"; import { PreferredScopeStage } from "./modifiers/PreferredScopeStage"; import { RangeModifierStage } from "./modifiers/RangeModifierStage"; import { RawSelectionStage } from "./modifiers/RawSelectionStage"; import { RelativeScopeStage } from "./modifiers/RelativeScopeStage"; -import { VisibleStage } from "./modifiers/VisibleStage"; -import type { ComplexModifier } from "./modifiers/modifier.types"; import type { ScopeHandlerFactory } from "./modifiers/scopeHandlers/ScopeHandlerFactory"; +import { VisibleStage } from "./modifiers/VisibleStage"; +import type { ModifierStageFactory } from "./ModifierStageFactory"; +import type { ModifierStage } from "./PipelineStages.types"; export class ModifierStageFactoryImpl implements ModifierStageFactory { constructor( diff --git a/packages/lib-engine/src/processTargets/TargetPipelineRunner.ts b/packages/lib-engine/src/processTargets/TargetPipelineRunner.ts index 3c8898fca0..c61020df7b 100644 --- a/packages/lib-engine/src/processTargets/TargetPipelineRunner.ts +++ b/packages/lib-engine/src/processTargets/TargetPipelineRunner.ts @@ -1,3 +1,4 @@ +import { zip } from "lodash-es"; import type { Direction, IDE, @@ -6,23 +7,22 @@ import type { ScopeType, } from "@cursorless/lib-common"; import { Range, uniqWithHash } from "@cursorless/lib-common"; -import { zip } from "lodash-es"; +import type { Target } from "../typings/target.types"; import type { PrimitiveTargetDescriptor, RangeTargetDescriptor, TargetDescriptor, } from "../typings/TargetDescriptor"; -import type { Target } from "../typings/target.types"; +import { createContinuousRangeTarget } from "./createContinuousRangeTarget"; +import { ImplicitStage } from "./marks/ImplicitStage"; import type { MarkStageFactory } from "./MarkStageFactory"; +import { ContainingTokenIfUntypedEmptyStage } from "./modifiers/ConditionalModifierStages"; import type { ModifierStageFactory } from "./ModifierStageFactory"; import type { MarkStage, ModifierStage, ModifierStateOptions, } from "./PipelineStages.types"; -import { createContinuousRangeTarget } from "./createContinuousRangeTarget"; -import { ImplicitStage } from "./marks/ImplicitStage"; -import { ContainingTokenIfUntypedEmptyStage } from "./modifiers/ConditionalModifierStages"; import { PlainTarget } from "./targets"; interface TargetPipelineRunnerOpts { diff --git a/packages/lib-engine/src/processTargets/marks/NothingStage.ts b/packages/lib-engine/src/processTargets/marks/NothingStage.ts index 1bd9b46d1d..dfe621f096 100644 --- a/packages/lib-engine/src/processTargets/marks/NothingStage.ts +++ b/packages/lib-engine/src/processTargets/marks/NothingStage.ts @@ -1,5 +1,5 @@ -import type { Target } from "../../typings/target.types"; import type { NothingMark } from "@cursorless/lib-common"; +import type { Target } from "../../typings/target.types"; import type { MarkStage } from "../PipelineStages.types"; export class NothingStage implements MarkStage { diff --git a/packages/lib-engine/src/processTargets/marks/RangeMarkStage.ts b/packages/lib-engine/src/processTargets/marks/RangeMarkStage.ts index 22ea4f363e..e84c1b0d59 100644 --- a/packages/lib-engine/src/processTargets/marks/RangeMarkStage.ts +++ b/packages/lib-engine/src/processTargets/marks/RangeMarkStage.ts @@ -1,5 +1,5 @@ -import type { RangeMark } from "../../typings/TargetDescriptor"; import type { Target } from "../../typings/target.types"; +import type { RangeMark } from "../../typings/TargetDescriptor"; import type { MarkStageFactory } from "../MarkStageFactory"; import type { MarkStage } from "../PipelineStages.types"; import { targetsToContinuousTarget } from "../TargetPipelineRunner"; diff --git a/packages/lib-engine/src/processTargets/marks/TargetMarkStage.ts b/packages/lib-engine/src/processTargets/marks/TargetMarkStage.ts index 1a07463610..88335d7af9 100644 --- a/packages/lib-engine/src/processTargets/marks/TargetMarkStage.ts +++ b/packages/lib-engine/src/processTargets/marks/TargetMarkStage.ts @@ -1,7 +1,7 @@ -import type { TargetPipelineRunner } from "../TargetPipelineRunner"; -import type { TargetMark } from "../../typings/TargetDescriptor"; import type { Target } from "../../typings/target.types"; +import type { TargetMark } from "../../typings/TargetDescriptor"; import type { MarkStage } from "../PipelineStages.types"; +import type { TargetPipelineRunner } from "../TargetPipelineRunner"; export class TargetMarkStage implements MarkStage { constructor( diff --git a/packages/lib-engine/src/processTargets/modifiers/EveryScopeStage.ts b/packages/lib-engine/src/processTargets/modifiers/EveryScopeStage.ts index 05cd3277b4..a3935ab47b 100644 --- a/packages/lib-engine/src/processTargets/modifiers/EveryScopeStage.ts +++ b/packages/lib-engine/src/processTargets/modifiers/EveryScopeStage.ts @@ -11,9 +11,9 @@ import type { ModifierStateOptions, } from "../PipelineStages.types"; import { getContainingScopeTarget } from "./getContainingScopeTarget"; -import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; import type { TargetScope } from "./scopeHandlers/scope.types"; import type { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; +import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; /** * This modifier returns all scopes intersecting the input target if the target diff --git a/packages/lib-engine/src/processTargets/modifiers/FilterStages.ts b/packages/lib-engine/src/processTargets/modifiers/FilterStages.ts index eceae4f433..e69babcf93 100644 --- a/packages/lib-engine/src/processTargets/modifiers/FilterStages.ts +++ b/packages/lib-engine/src/processTargets/modifiers/FilterStages.ts @@ -1,8 +1,8 @@ -import type { Target } from "../../typings/target.types"; import type { KeepContentFilterModifier, KeepEmptyFilterModifier, } from "@cursorless/lib-common"; +import type { Target } from "../../typings/target.types"; import type { ModifierStage } from "../PipelineStages.types"; export class KeepContentFilterStage implements ModifierStage { diff --git a/packages/lib-engine/src/processTargets/modifiers/InstanceStage.ts b/packages/lib-engine/src/processTargets/modifiers/InstanceStage.ts index 93b5335a1a..bc3a0a4dcc 100644 --- a/packages/lib-engine/src/processTargets/modifiers/InstanceStage.ts +++ b/packages/lib-engine/src/processTargets/modifiers/InstanceStage.ts @@ -1,3 +1,5 @@ +import { flatmap, ifilter, imap, itake } from "itertools"; +import { escapeRegExp } from "lodash-es"; import type { Direction, Modifier, @@ -7,8 +9,6 @@ import type { TextEditor, } from "@cursorless/lib-common"; import { Range } from "@cursorless/lib-common"; -import { flatmap, ifilter, imap, itake } from "itertools"; -import { escapeRegExp } from "lodash-es"; import type { StoredTargetMap } from "../.."; import type { Target } from "../../typings/target.types"; import { generateMatchesInRange } from "../../util/getMatchesInRange"; diff --git a/packages/lib-engine/src/processTargets/modifiers/RawSelectionStage.ts b/packages/lib-engine/src/processTargets/modifiers/RawSelectionStage.ts index 3b4984c61c..43ba061d63 100644 --- a/packages/lib-engine/src/processTargets/modifiers/RawSelectionStage.ts +++ b/packages/lib-engine/src/processTargets/modifiers/RawSelectionStage.ts @@ -1,5 +1,5 @@ -import type { Target } from "../../typings/target.types"; import type { RawSelectionModifier } from "@cursorless/lib-common"; +import type { Target } from "../../typings/target.types"; import type { ModifierStage } from "../PipelineStages.types"; import { RawSelectionTarget } from "../targets"; diff --git a/packages/lib-engine/src/processTargets/modifiers/RelativeScopeStage.ts b/packages/lib-engine/src/processTargets/modifiers/RelativeScopeStage.ts index 1b5aa90fe2..fa80d1d21a 100644 --- a/packages/lib-engine/src/processTargets/modifiers/RelativeScopeStage.ts +++ b/packages/lib-engine/src/processTargets/modifiers/RelativeScopeStage.ts @@ -1,3 +1,4 @@ +import { find, ifilter, islice, itake } from "itertools"; import type { Direction, Position, @@ -6,19 +7,18 @@ import type { TextEditor, } from "@cursorless/lib-common"; import { NoContainingScopeError } from "@cursorless/lib-common"; -import { find, ifilter, islice, itake } from "itertools"; import type { Target } from "../../typings/target.types"; import type { ModifierStage } from "../PipelineStages.types"; import { InteriorTarget } from "../targets"; import { constructScopeRangeTarget } from "./constructScopeRangeTarget"; import { getPreferredScopeTouchingPosition } from "./getPreferredScopeTouchingPosition"; import { OutOfRangeError } from "./listUtils"; -import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; import type { TargetScope } from "./scopeHandlers/scope.types"; import type { ContainmentPolicy, ScopeHandler, } from "./scopeHandlers/scopeHandler.types"; +import type { ScopeHandlerFactory } from "./scopeHandlers/ScopeHandlerFactory"; /** * Handles relative modifiers input, eg "next funk", "two funks", "previous two diff --git a/packages/lib-engine/src/processTargets/modifiers/getContainingScopeTarget.ts b/packages/lib-engine/src/processTargets/modifiers/getContainingScopeTarget.ts index 81fa068018..a3ff5d6a0e 100644 --- a/packages/lib-engine/src/processTargets/modifiers/getContainingScopeTarget.ts +++ b/packages/lib-engine/src/processTargets/modifiers/getContainingScopeTarget.ts @@ -1,9 +1,9 @@ import type { Direction, Position, TextEditor } from "@cursorless/lib-common"; import type { Target } from "../../typings/target.types"; import { constructScopeRangeTarget } from "./constructScopeRangeTarget"; +import { getPreferredScopeTouchingPosition } from "./getPreferredScopeTouchingPosition"; import type { TargetScope } from "./scopeHandlers/scope.types"; import type { ScopeHandler } from "./scopeHandlers/scopeHandler.types"; -import { getPreferredScopeTouchingPosition } from "./getPreferredScopeTouchingPosition"; /** * Finds the containing scope of the target for the given scope handler diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts index 0ac7b664aa..68e445a2e0 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts @@ -1,13 +1,13 @@ +import * as assert from "node:assert/strict"; import type { TextEditor, Direction } from "@cursorless/lib-common"; import { Position, Range } from "@cursorless/lib-common"; import { BaseScopeHandler } from "./BaseScopeHandler"; +import { compareTargetScopes } from "./compareTargetScopes"; import type { TargetScope } from "./scope.types"; import type { CustomScopeType, ScopeIteratorRequirements, } from "./scopeHandler.types"; -import { compareTargetScopes } from "./compareTargetScopes"; -import * as assert from "node:assert/strict"; class TestScopeHandler extends BaseScopeHandler { public scopeType = undefined; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts index 3c3b1d9a81..b1f0e401fa 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CharacterScopeHandler.ts @@ -1,5 +1,5 @@ -import type { Direction, IDE, ScopeType } from "@cursorless/lib-common"; import { imap } from "itertools"; +import type { Direction, IDE, ScopeType } from "@cursorless/lib-common"; import { getMatcher } from "../../../tokenizer"; import { generateMatchesInRange } from "../../../util/getMatchesInRange"; import { PlainTarget } from "../../targets"; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CollectionItemScopeHandler/CollectionItemScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CollectionItemScopeHandler/CollectionItemScopeHandler.ts index 4b502f0379..c904cff854 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CollectionItemScopeHandler/CollectionItemScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/CollectionItemScopeHandler/CollectionItemScopeHandler.ts @@ -6,7 +6,6 @@ import type { } from "@cursorless/lib-common"; import type { LanguageDefinitions } from "../../../../languages/LanguageDefinitions"; import { BaseScopeHandler } from "../BaseScopeHandler"; -import { SortedScopeHandler } from "../SortedScopeHandler"; import type { TargetScope } from "../scope.types"; import type { ComplexScopeType, @@ -14,6 +13,7 @@ import type { ScopeIteratorRequirements, } from "../scopeHandler.types"; import type { ScopeHandlerFactory } from "../ScopeHandlerFactory"; +import { SortedScopeHandler } from "../SortedScopeHandler"; import { CollectionItemTextualScopeHandler } from "./CollectionItemTextualScopeHandler"; export class CollectionItemScopeHandler extends BaseScopeHandler { diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/ConditionalScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/ConditionalScopeHandler.ts index 46f505e844..6c8e454a3a 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/ConditionalScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/ConditionalScopeHandler.ts @@ -1,3 +1,4 @@ +import { ifilter } from "itertools"; import { NoContainingScopeError, type Direction, @@ -5,7 +6,6 @@ import { type ScopeType, type TextEditor, } from "@cursorless/lib-common"; -import { ifilter } from "itertools"; import { BaseScopeHandler } from "./BaseScopeHandler"; import type { TargetScope } from "./scope.types"; import type { diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/FallbackScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/FallbackScopeHandler.ts index 445812f533..515098135f 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/FallbackScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/FallbackScopeHandler.ts @@ -4,13 +4,13 @@ import { type TextEditor, } from "@cursorless/lib-common"; import { BaseScopeHandler } from "./BaseScopeHandler"; -import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import type { TargetScope } from "./scope.types"; import type { FallbackScopeType, ScopeHandler, ScopeIteratorRequirements, } from "./scopeHandler.types"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; export class FallbackScopeHandler extends BaseScopeHandler { public scopeType = undefined; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts index c941888b50..dfc0dcc9d3 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/IdentifierScopeHandler.ts @@ -1,5 +1,5 @@ -import type { Direction, IDE, ScopeType } from "@cursorless/lib-common"; import { imap } from "itertools"; +import type { Direction, IDE, ScopeType } from "@cursorless/lib-common"; import { getMatcher } from "../../../tokenizer"; import { generateMatchesInRange } from "../../../util/getMatchesInRange"; import { TokenTarget } from "../../targets"; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts index 4f47cc574a..bd3393e6bd 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/NestedScopeHandler.ts @@ -1,17 +1,17 @@ +import { flatmap } from "itertools"; import type { Direction, Position, ScopeType, TextEditor, } from "@cursorless/lib-common"; -import { flatmap } from "itertools"; import { BaseScopeHandler } from "./BaseScopeHandler"; -import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import type { TargetScope } from "./scope.types"; import type { ScopeHandler, ScopeIteratorRequirements, } from "./scopeHandler.types"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; /** * This class can be used to define scope types that are most easily defined by diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts index 818e25860d..aaeffc105e 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/RegexScopeHandler.ts @@ -1,16 +1,16 @@ +import { imap } from "itertools"; +import { escapeRegExp } from "lodash-es"; import type { CustomRegexScopeType, Direction, GlyphScopeType, ScopeType, } from "@cursorless/lib-common"; -import { imap } from "itertools"; -import { escapeRegExp } from "lodash-es"; -import { NestedScopeHandler } from "./NestedScopeHandler"; -import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import { generateMatchesInRange } from "../../../util/getMatchesInRange"; import { TokenTarget } from "../../targets"; +import { NestedScopeHandler } from "./NestedScopeHandler"; import type { TargetScope } from "./scope.types"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; abstract class RegexStageBase extends NestedScopeHandler { public readonly iterationScopeType: ScopeType = { type: "line" }; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts index b71bac0929..4111bb87dd 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceScopeHandler.ts @@ -1,6 +1,6 @@ +import { imap } from "itertools"; import type { Direction, MatchedText } from "@cursorless/lib-common"; import { Range } from "@cursorless/lib-common"; -import { imap } from "itertools"; import { TokenTarget } from "../../../targets"; import { NestedScopeHandler } from "../NestedScopeHandler"; import type { TargetScope } from "../scope.types"; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SortedScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SortedScopeHandler.ts index 10dc28fb2c..70154b1671 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SortedScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SortedScopeHandler.ts @@ -1,8 +1,7 @@ import type { Direction, Position, TextEditor } from "@cursorless/lib-common"; import { BaseScopeHandler } from "./BaseScopeHandler"; -import { advanceIteratorsUntil, getInitialIteratorInfos } from "./IteratorInfo"; -import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import { compareTargetScopes } from "./compareTargetScopes"; +import { advanceIteratorsUntil, getInitialIteratorInfos } from "./IteratorInfo"; import type { TargetScope } from "./scope.types"; import type { CustomScopeType, @@ -10,6 +9,7 @@ import type { ScopeIteratorRequirements, SortedScopeType, } from "./scopeHandler.types"; +import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; export class SortedScopeHandler extends BaseScopeHandler { protected isHierarchical = true; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts index 48a7821d05..45622d0a15 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/SurroundingPairScopeHandler.ts @@ -12,12 +12,12 @@ import type { ConditionalScopeType, ScopeIteratorRequirements, } from "../scopeHandler.types"; +import { scopeHandlerCache } from "../ScopeHandlerCache"; import { createTargetScope } from "./createTargetScope"; import { getDelimiterOccurrences } from "./getDelimiterOccurrences"; import { getIndividualDelimiters } from "./getIndividualDelimiters"; import { getSurroundingPairOccurrences } from "./getSurroundingPairOccurrences"; import type { SurroundingPairOccurrence } from "./types"; -import { scopeHandlerCache } from "../ScopeHandlerCache"; export class SurroundingPairScopeHandler extends BaseScopeHandler { public readonly iterationScopeType: ConditionalScopeType = { diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts index 8302211f7a..071ef4d5db 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getIndividualDelimiters.ts @@ -1,10 +1,10 @@ +import { concat, uniq } from "lodash-es"; import type { ComplexSurroundingPairName, SimpleSurroundingPairName, SurroundingPairName, } from "@cursorless/lib-common"; import { isString } from "@cursorless/lib-common"; -import { concat, uniq } from "lodash-es"; import { complexDelimiterMap, getSimpleDelimiterMap } from "./delimiterMaps"; import type { IndividualDelimiter } from "./types"; import { DelimiterSide } from "./types"; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts index 973647a6b5..2b9767c38b 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/getSurroundingPairOccurrences.ts @@ -1,5 +1,5 @@ -import type { Range } from "@cursorless/lib-common"; import findLastIndex from "lodash-es/findLastIndex"; +import type { Range } from "@cursorless/lib-common"; import { DelimiterSide } from "./types"; import type { DelimiterOccurrence, diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts index b9a78c3cf4..ccc61b5247 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TokenScopeHandler.ts @@ -1,5 +1,5 @@ -import type { Direction, IDE, ScopeType } from "@cursorless/lib-common"; import { imap } from "itertools"; +import type { Direction, IDE, ScopeType } from "@cursorless/lib-common"; import { getMatcher } from "../../../tokenizer"; import { generateMatchesInRange } from "../../../util/getMatchesInRange"; import { TokenTarget } from "../../targets"; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts index 28ba9a8843..d9b3c236d4 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/BaseTreeSitterScopeHandler.ts @@ -1,3 +1,4 @@ +import { uniqWith } from "lodash-es"; import type { Direction, IDE, @@ -5,7 +6,6 @@ import type { TextEditor, } from "@cursorless/lib-common"; import { showError } from "@cursorless/lib-common"; -import { uniqWith } from "lodash-es"; import type { TreeSitterQuery } from "../../../../languages/TreeSitterQuery"; import type { QueryMatch } from "../../../../languages/TreeSitterQuery/QueryCapture"; import { BaseScopeHandler } from "../BaseScopeHandler"; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts index fe75a444bc..b56951f39a 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/TreeSitterScopeHandler/TreeSitterScopeHandler.ts @@ -6,8 +6,8 @@ import type { CustomScopeType } from "../scopeHandler.types"; import { getCollectionItemRemovalRange } from "../util/getCollectionItemRemovalRange"; import type { ExtendedTargetScope } from "./BaseTreeSitterScopeHandler"; import { BaseTreeSitterScopeHandler } from "./BaseTreeSitterScopeHandler"; -import { TreeSitterIterationScopeHandler } from "./TreeSitterIterationScopeHandler"; import { findCaptureByName, getRelatedRange } from "./captureUtils"; +import { TreeSitterIterationScopeHandler } from "./TreeSitterIterationScopeHandler"; /** * Handles scopes that are implemented using tree-sitter. diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts index c9d0b112d1..ed9a401fae 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts @@ -8,8 +8,8 @@ import { Range } from "@cursorless/lib-common"; import { SubTokenWordTarget } from "../../../targets"; import { NestedScopeHandler } from "../NestedScopeHandler"; import type { TargetScope } from "../scope.types"; -import { WordTokenizer } from "./WordTokenizer"; import type { ScopeHandlerFactory } from "../ScopeHandlerFactory"; +import { WordTokenizer } from "./WordTokenizer"; export class WordScopeHandler extends NestedScopeHandler { public readonly scopeType = { type: "word" } as const; diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts index 25565f8d48..4c9b108dd0 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts @@ -1,6 +1,6 @@ +import * as assert from "node:assert/strict"; import { Range } from "@cursorless/lib-common"; import { OneWayNestedRangeFinder } from "./OneWayNestedRangeFinder"; -import * as assert from "node:assert/strict"; const items = [ { range: new Range(0, 0, 0, 5) }, diff --git a/packages/lib-engine/src/processTargets/modifiers/targetSequenceUtils.ts b/packages/lib-engine/src/processTargets/modifiers/targetSequenceUtils.ts index d4da9279f0..e7459afd48 100644 --- a/packages/lib-engine/src/processTargets/modifiers/targetSequenceUtils.ts +++ b/packages/lib-engine/src/processTargets/modifiers/targetSequenceUtils.ts @@ -1,9 +1,9 @@ import type { ScopeType } from "@cursorless/lib-common"; import type { Target } from "../../typings/target.types"; -import type { ModifierStageFactory } from "../ModifierStageFactory"; import { createContinuousRangeTarget } from "../createContinuousRangeTarget"; -import { assertIndices } from "./listUtils"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; import type { ModifierStateOptions } from "../PipelineStages.types"; +import { assertIndices } from "./listUtils"; /** * Construct a single range target between two targets in a list of targets, diff --git a/packages/lib-engine/src/processTargets/targets/BaseTarget.ts b/packages/lib-engine/src/processTargets/targets/BaseTarget.ts index 926e084f4e..d51326c030 100644 --- a/packages/lib-engine/src/processTargets/targets/BaseTarget.ts +++ b/packages/lib-engine/src/processTargets/targets/BaseTarget.ts @@ -1,3 +1,4 @@ +import { isEqual } from "lodash-es"; import type { EnforceUndefined, GeneralizedRange, @@ -7,13 +8,12 @@ import type { TextEditor, } from "@cursorless/lib-common"; import { rangeToPlainObject, Selection } from "@cursorless/lib-common"; -import { isEqual } from "lodash-es"; -import type { EditWithRangeUpdater } from "../../typings/Types"; import type { Destination, Target, TextualType, } from "../../typings/target.types"; +import type { EditWithRangeUpdater } from "../../typings/Types"; import { toGeneralizedRange } from "../../util/targetUtils"; import { DestinationImpl } from "./DestinationImpl"; import { createContinuousRange } from "./util/createContinuousRange"; diff --git a/packages/lib-engine/src/processTargets/targets/DestinationImpl.ts b/packages/lib-engine/src/processTargets/targets/DestinationImpl.ts index 84040a75bc..6006f3a5b4 100644 --- a/packages/lib-engine/src/processTargets/targets/DestinationImpl.ts +++ b/packages/lib-engine/src/processTargets/targets/DestinationImpl.ts @@ -1,11 +1,11 @@ import type { InsertionMode, TextEditor } from "@cursorless/lib-common"; import { Range, Selection } from "@cursorless/lib-common"; -import type { EditWithRangeUpdater } from "../../typings/Types"; import type { Destination, EditNewActionType, Target, } from "../../typings/target.types"; +import type { EditWithRangeUpdater } from "../../typings/Types"; import { union } from "../../util/rangeUtils"; export class DestinationImpl implements Destination { diff --git a/packages/lib-engine/src/processTargets/targets/HeadTailTarget.ts b/packages/lib-engine/src/processTargets/targets/HeadTailTarget.ts index 0d63d17ac1..d994d19890 100644 --- a/packages/lib-engine/src/processTargets/targets/HeadTailTarget.ts +++ b/packages/lib-engine/src/processTargets/targets/HeadTailTarget.ts @@ -1,13 +1,13 @@ import { Range } from "@cursorless/lib-common"; +import type { Target } from "../../typings/target.types"; import type { MinimumTargetParameters } from "./BaseTarget"; import { BaseTarget } from "./BaseTarget"; -import type { Target } from "../../typings/target.types"; +import { PlainTarget } from "./PlainTarget"; import { getTokenLeadingDelimiterTarget, getTokenRemovalRange, getTokenTrailingDelimiterTarget, } from "./util/insertionRemovalBehaviors/TokenInsertionRemovalBehavior"; -import { PlainTarget } from "./PlainTarget"; export interface HeadTailTargetParameters extends MinimumTargetParameters { inputTarget: Target; diff --git a/packages/lib-engine/src/processTargets/targets/NotebookCellDestination.ts b/packages/lib-engine/src/processTargets/targets/NotebookCellDestination.ts index 60a2c9ee24..25f1db223e 100644 --- a/packages/lib-engine/src/processTargets/targets/NotebookCellDestination.ts +++ b/packages/lib-engine/src/processTargets/targets/NotebookCellDestination.ts @@ -4,11 +4,11 @@ import type { Selection, TextEditor, } from "@cursorless/lib-common"; -import type { EditWithRangeUpdater } from "../../typings/Types"; import type { Destination, EditNewActionType, } from "../../typings/target.types"; +import type { EditWithRangeUpdater } from "../../typings/Types"; import type { NotebookCellTarget } from "./NotebookCellTarget"; export class NotebookCellDestination implements Destination { diff --git a/packages/lib-engine/src/processTargets/targets/NotebookCellTarget.ts b/packages/lib-engine/src/processTargets/targets/NotebookCellTarget.ts index b9a6b8caa4..1b655cc5a4 100644 --- a/packages/lib-engine/src/processTargets/targets/NotebookCellTarget.ts +++ b/packages/lib-engine/src/processTargets/targets/NotebookCellTarget.ts @@ -1,7 +1,7 @@ import type { InsertionMode } from "@cursorless/lib-common"; +import type { Destination } from "../../typings/target.types"; 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/lib-engine/src/processTargets/targets/ScopeTypeTarget.ts b/packages/lib-engine/src/processTargets/targets/ScopeTypeTarget.ts index 821bed54f2..a8603755cc 100644 --- a/packages/lib-engine/src/processTargets/targets/ScopeTypeTarget.ts +++ b/packages/lib-engine/src/processTargets/targets/ScopeTypeTarget.ts @@ -9,11 +9,11 @@ import type { CommonTargetParameters } from "./BaseTarget"; import { BaseTarget } from "./BaseTarget"; import { PlainTarget } from "./PlainTarget"; import { getDelimitedSequenceRemovalRange } from "./util/insertionRemovalBehaviors/DelimitedSequenceInsertionRemovalBehavior"; +import { getSmartRemovalTarget } from "./util/insertionRemovalBehaviors/getSmartRemovalTarget"; import { getTokenLeadingDelimiterTarget, getTokenTrailingDelimiterTarget, } from "./util/insertionRemovalBehaviors/TokenInsertionRemovalBehavior"; -import { getSmartRemovalTarget } from "./util/insertionRemovalBehaviors/getSmartRemovalTarget"; export interface ScopeTypeTargetParameters extends CommonTargetParameters { readonly scopeTypeType: SimpleScopeTypeType; diff --git a/packages/lib-engine/src/processTargets/targets/SurroundingPairTarget.ts b/packages/lib-engine/src/processTargets/targets/SurroundingPairTarget.ts index 793cce378b..5b2a1bdb2f 100644 --- a/packages/lib-engine/src/processTargets/targets/SurroundingPairTarget.ts +++ b/packages/lib-engine/src/processTargets/targets/SurroundingPairTarget.ts @@ -1,9 +1,9 @@ import type { Range } from "@cursorless/lib-common"; +import type { Target } from "../../typings/target.types"; import type { CommonTargetParameters } from "./BaseTarget"; import { BaseTarget } from "./BaseTarget"; import { InteriorTarget } from "./InteriorTarget"; import { TokenTarget } from "./TokenTarget"; -import type { Target } from "../../typings/target.types"; import { getTokenLeadingDelimiterTarget, getTokenRemovalRange, diff --git a/packages/lib-engine/src/runCommand.ts b/packages/lib-engine/src/runCommand.ts index a750a84f0d..0a83ff7de1 100644 --- a/packages/lib-engine/src/runCommand.ts +++ b/packages/lib-engine/src/runCommand.ts @@ -8,20 +8,20 @@ import type { TreeSitter, } from "@cursorless/lib-common"; import { clientSupportsFallback } from "@cursorless/lib-common"; -import type { CommandRunner } from "./CommandRunner"; import { Actions } from "./actions/Actions"; import type { CommandRunnerDecorator } from "./api/CursorlessEngineApi"; +import type { CommandRunner } from "./CommandRunner"; +import { CommandRunnerImpl } from "./core/commandRunner/CommandRunnerImpl"; +import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import type { Debug } from "./core/Debug"; import type { Snippets } from "./core/Snippets"; import type { StoredTargetMap } from "./core/StoredTargets"; -import { CommandRunnerImpl } from "./core/commandRunner/CommandRunnerImpl"; -import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import type { RangeUpdater } from "./core/updateSelections/RangeUpdater"; import type { LanguageDefinitions } from "./languages/LanguageDefinitions"; import { TargetPipelineRunner } from "./processTargets"; import { MarkStageFactoryImpl } from "./processTargets/MarkStageFactoryImpl"; -import { ModifierStageFactoryImpl } from "./processTargets/ModifierStageFactoryImpl"; import { ScopeHandlerFactoryImpl } from "./processTargets/modifiers/scopeHandlers"; +import { ModifierStageFactoryImpl } from "./processTargets/ModifierStageFactoryImpl"; /** * Entry point for Cursorless commands. We proceed as follows: diff --git a/packages/lib-engine/src/scopeProviders/ScopeInfoProvider.ts b/packages/lib-engine/src/scopeProviders/ScopeInfoProvider.ts index d447cefa95..f4a7c849d9 100644 --- a/packages/lib-engine/src/scopeProviders/ScopeInfoProvider.ts +++ b/packages/lib-engine/src/scopeProviders/ScopeInfoProvider.ts @@ -1,3 +1,4 @@ +import { pull } from "lodash-es"; import type { Disposable, ScopeType, @@ -10,8 +11,6 @@ import { simpleScopeTypeTypes, surroundingPairNames, } from "@cursorless/lib-common"; -import { pull } from "lodash-es"; - import type { CustomSpokenFormGeneratorImpl } from "../generateSpokenForm/CustomSpokenFormGeneratorImpl"; import { scopeTypeToString } from "./scopeTypeToString"; diff --git a/packages/lib-engine/src/scopeProviders/ScopeRangeProvider.ts b/packages/lib-engine/src/scopeProviders/ScopeRangeProvider.ts index c48127aae2..64f892a6da 100644 --- a/packages/lib-engine/src/scopeProviders/ScopeRangeProvider.ts +++ b/packages/lib-engine/src/scopeProviders/ScopeRangeProvider.ts @@ -7,8 +7,8 @@ import type { TextEditor, } from "@cursorless/lib-common"; import { Range } from "@cursorless/lib-common"; -import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import type { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; +import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { getIterationRange } from "./getIterationRange"; import { getIterationScopeRanges } from "./getIterationScopeRanges"; import { getScopeRanges } from "./getScopeRanges"; diff --git a/packages/lib-engine/src/scopeProviders/ScopeRangeWatcher.ts b/packages/lib-engine/src/scopeProviders/ScopeRangeWatcher.ts index 534281c872..f5069a6685 100644 --- a/packages/lib-engine/src/scopeProviders/ScopeRangeWatcher.ts +++ b/packages/lib-engine/src/scopeProviders/ScopeRangeWatcher.ts @@ -1,3 +1,4 @@ +import { pull } from "lodash-es"; import type { Disposable, IDE, @@ -8,8 +9,6 @@ import type { ScopeRanges, } from "@cursorless/lib-common"; import { showError } from "@cursorless/lib-common"; -import { pull } from "lodash-es"; - import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; import { DecorationDebouncer } from "../util/DecorationDebouncer"; import type { ScopeRangeProvider } from "./ScopeRangeProvider"; diff --git a/packages/lib-engine/src/scopeProviders/ScopeSupportChecker.ts b/packages/lib-engine/src/scopeProviders/ScopeSupportChecker.ts index 75d3fee8e0..a48715ac35 100644 --- a/packages/lib-engine/src/scopeProviders/ScopeSupportChecker.ts +++ b/packages/lib-engine/src/scopeProviders/ScopeSupportChecker.ts @@ -4,8 +4,8 @@ import { ScopeSupport, isEmptyIterable, } from "@cursorless/lib-common"; -import type { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; +import type { ScopeHandlerFactory } from "../processTargets/modifiers/scopeHandlers/ScopeHandlerFactory"; /** * Determines the level of support for a given scope type in a given editor. diff --git a/packages/lib-engine/src/scopeProviders/ScopeSupportWatcher.ts b/packages/lib-engine/src/scopeProviders/ScopeSupportWatcher.ts index b3e6a10bcf..9b94b94164 100644 --- a/packages/lib-engine/src/scopeProviders/ScopeSupportWatcher.ts +++ b/packages/lib-engine/src/scopeProviders/ScopeSupportWatcher.ts @@ -1,3 +1,4 @@ +import { pull } from "lodash-es"; import type { Disposable, IDE, @@ -6,7 +7,6 @@ import type { ScopeType, } from "@cursorless/lib-common"; import { ScopeSupport, disposableFrom } from "@cursorless/lib-common"; -import { pull } from "lodash-es"; import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; import { DecorationDebouncer } from "../util/DecorationDebouncer"; import type { ScopeInfoProvider } from "./ScopeInfoProvider"; diff --git a/packages/lib-engine/src/scopeProviders/getIterationRange.ts b/packages/lib-engine/src/scopeProviders/getIterationRange.ts index f5f769e092..9498792683 100644 --- a/packages/lib-engine/src/scopeProviders/getIterationRange.ts +++ b/packages/lib-engine/src/scopeProviders/getIterationRange.ts @@ -1,5 +1,5 @@ -import type { Range, TextEditor } from "@cursorless/lib-common"; import { last } from "lodash-es"; +import type { Range, TextEditor } from "@cursorless/lib-common"; import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; /** diff --git a/packages/lib-engine/src/scopeProviders/getIterationScopeRanges.ts b/packages/lib-engine/src/scopeProviders/getIterationScopeRanges.ts index 678f84f25e..55c6fc512a 100644 --- a/packages/lib-engine/src/scopeProviders/getIterationScopeRanges.ts +++ b/packages/lib-engine/src/scopeProviders/getIterationScopeRanges.ts @@ -1,14 +1,14 @@ +import { map } from "itertools"; import type { IterationScopeRanges, Range, TextEditor, } from "@cursorless/lib-common"; -import { map } from "itertools"; +import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; import type { ModifierStage, ModifierStateOptions, } 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/lib-engine/src/scopeProviders/getScopeRanges.ts b/packages/lib-engine/src/scopeProviders/getScopeRanges.ts index a18f199116..6ac05585d1 100644 --- a/packages/lib-engine/src/scopeProviders/getScopeRanges.ts +++ b/packages/lib-engine/src/scopeProviders/getScopeRanges.ts @@ -1,6 +1,5 @@ -import type { Range, ScopeRanges, TextEditor } from "@cursorless/lib-common"; import { map } from "itertools"; - +import type { Range, ScopeRanges, TextEditor } from "@cursorless/lib-common"; import type { ScopeHandler } from "../processTargets/modifiers/scopeHandlers/scopeHandler.types"; import { getTargetRanges } from "./getTargetRanges"; diff --git a/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts b/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts index 5a8285b675..b5638366a3 100644 --- a/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts +++ b/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts @@ -1,7 +1,7 @@ -import type { TestCaseFixtureLegacy } from "@cursorless/lib-common"; -import { FakeIDE } from "@cursorless/lib-common"; import * as assert from "node:assert/strict"; import { uniq } from "lodash-es"; +import type { TestCaseFixtureLegacy } from "@cursorless/lib-common"; +import { FakeIDE } from "@cursorless/lib-common"; import { extractTargetKeys } from "../../testUtil/extractTargetKeys"; import { TokenGraphemeSplitter } from "../../tokenGraphemeSplitter/tokenGraphemeSplitter"; import { getPartialTargetDescriptors } from "../../util/getPartialTargetDescriptors"; diff --git a/packages/lib-engine/src/scripts/transformRecordedTests/index.ts b/packages/lib-engine/src/scripts/transformRecordedTests/index.ts index 5557332e83..b788d9f8bd 100644 --- a/packages/lib-engine/src/scripts/transformRecordedTests/index.ts +++ b/packages/lib-engine/src/scripts/transformRecordedTests/index.ts @@ -5,10 +5,10 @@ import type { import { LATEST_VERSION } from "@cursorless/lib-common"; import { getRecordedTestPaths } from "@cursorless/lib-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 { transformFile } from "./transformFile"; import type { FixtureTransformation } from "./types"; import { upgradeDecorations } from "./upgradeDecorations"; diff --git a/packages/lib-engine/src/scripts/transformRecordedTests/moveFile.ts b/packages/lib-engine/src/scripts/transformRecordedTests/moveFile.ts index 614a2a0a9a..1727ca19fe 100644 --- a/packages/lib-engine/src/scripts/transformRecordedTests/moveFile.ts +++ b/packages/lib-engine/src/scripts/transformRecordedTests/moveFile.ts @@ -1,7 +1,7 @@ import { promises as fsp } from "node:fs"; +import { mkdir, rename } from "node:fs/promises"; import * as path from "node:path"; import * as yaml from "js-yaml"; -import { mkdir, rename } from "node:fs/promises"; import type { TestCaseFixture } from "@cursorless/lib-common"; /** diff --git a/packages/lib-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts b/packages/lib-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts index 80aed64c06..e5abe2e829 100644 --- a/packages/lib-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts +++ b/packages/lib-engine/src/scripts/transformRecordedTests/upgradeDecorations.ts @@ -1,10 +1,10 @@ +import { groupBy, partition } from "lodash-es"; import type { FlashStyle, GeneralizedRangePlainObject, PositionPlainObject, TestCaseFixtureLegacy, } from "@cursorless/lib-common"; -import { groupBy, partition } from "lodash-es"; import type { FixtureTransformation } from "./types"; interface PlainTestDecoration { diff --git a/packages/lib-engine/src/spokenForms/CustomSpokenForms.ts b/packages/lib-engine/src/spokenForms/CustomSpokenForms.ts index 55c96d0763..667b077070 100644 --- a/packages/lib-engine/src/spokenForms/CustomSpokenForms.ts +++ b/packages/lib-engine/src/spokenForms/CustomSpokenForms.ts @@ -1,3 +1,4 @@ +import { isEqual } from "lodash-es"; import type { CustomRegexScopeType, Disposable, @@ -14,13 +15,12 @@ import { SUPPORTED_ENTRY_TYPES, showError, } from "@cursorless/lib-common"; -import { isEqual } from "lodash-es"; -import type { SpokenFormMap, SpokenFormMapEntry } from "./SpokenFormMap"; import { defaultSpokenFormInfoMap, defaultSpokenFormMap, } from "./defaultSpokenFormMap"; import type { DefaultSpokenFormMapEntry } from "./defaultSpokenFormMap.types"; +import type { SpokenFormMap, SpokenFormMapEntry } from "./SpokenFormMap"; type Writable = { -readonly [K in keyof T]: T[K]; diff --git a/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.ts b/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.ts index a31d7cc939..d6c6d216a5 100644 --- a/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.ts +++ b/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.ts @@ -1,7 +1,7 @@ +import type { DefaultSpokenFormInfoMap } from "./defaultSpokenFormMap.types"; +import { defaultSpokenFormMapCore } from "./defaultSpokenFormMapCore"; import type { SpokenFormMap } from "./SpokenFormMap"; import { mapSpokenForms } from "./SpokenFormMap"; -import { defaultSpokenFormMapCore } from "./defaultSpokenFormMapCore"; -import type { DefaultSpokenFormInfoMap } from "./defaultSpokenFormMap.types"; /** * This map contains information about the default spoken forms for all our diff --git a/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.types.ts b/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.types.ts index 4672c96571..ffe714d50c 100644 --- a/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.types.ts +++ b/packages/lib-engine/src/spokenForms/defaultSpokenFormMap.types.ts @@ -1,5 +1,5 @@ -import type { SpokenFormMappingType } from "./SpokenFormMap"; import type { SpokenFormMapKeyTypes } from "@cursorless/lib-common"; +import type { SpokenFormMappingType } from "./SpokenFormMap"; export type DefaultSpokenFormMapDefinition = { readonly [K in keyof SpokenFormMapKeyTypes]: Readonly< diff --git a/packages/lib-engine/src/test/scopes.test.ts b/packages/lib-engine/src/test/scopes.test.ts index 3050482a4c..9b8d0d8718 100644 --- a/packages/lib-engine/src/test/scopes.test.ts +++ b/packages/lib-engine/src/test/scopes.test.ts @@ -1,3 +1,6 @@ +import * as assert from "node:assert/strict"; +import { promises as fsp } from "node:fs"; +import { groupBy, uniq } from "lodash-es"; import type { PlaintextScopeSupportFacet, ScopeRangeConfig, @@ -13,9 +16,6 @@ import { shouldUpdateFixtures, } from "@cursorless/lib-common"; import { getScopeTestPathsRecursively } from "@cursorless/lib-node-common"; -import { groupBy, uniq } from "lodash-es"; -import { promises as fsp } from "node:fs"; -import * as assert from "node:assert/strict"; import type { TestEnvironment } from "../testUtil/createTestEnvironment"; import { createTestEnvironment } from "../testUtil/createTestEnvironment"; import { diff --git a/packages/lib-engine/src/test/spokenForms.talon.test.ts b/packages/lib-engine/src/test/spokenForms.talon.test.ts index 68af44ae31..422e9f07a7 100644 --- a/packages/lib-engine/src/test/spokenForms.talon.test.ts +++ b/packages/lib-engine/src/test/spokenForms.talon.test.ts @@ -1,3 +1,6 @@ +import * as assert from "node:assert/strict"; +import { promises as fsp } from "node:fs"; +import * as yaml from "js-yaml"; import type { Command, CommandLatest, @@ -5,9 +8,6 @@ import type { } from "@cursorless/lib-common"; import { asyncSafety } from "@cursorless/lib-common"; import { getRecordedTestPaths } from "@cursorless/lib-node-common"; -import * as assert from "node:assert/strict"; -import * as yaml from "js-yaml"; -import { promises as fsp } from "node:fs"; import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; import { getHatMapCommand } from "../generateSpokenForm/getHatMapCommand"; import { TalonRepl } from "../testUtil/TalonRepl"; diff --git a/packages/lib-engine/src/test/subtoken.test.ts b/packages/lib-engine/src/test/subtoken.test.ts index 13f39b9277..768673e3cc 100644 --- a/packages/lib-engine/src/test/subtoken.test.ts +++ b/packages/lib-engine/src/test/subtoken.test.ts @@ -1,5 +1,5 @@ -import { FakeIDE } from "@cursorless/lib-common"; import * as assert from "node:assert/strict"; +import { FakeIDE } from "@cursorless/lib-common"; import { WordTokenizer } from "../processTargets/modifiers/scopeHandlers/WordScopeHandler/WordTokenizer"; import { subtokenFixture } from "./fixtures/subtoken.fixture"; diff --git a/packages/lib-engine/src/testUtil/TalonRepl.ts b/packages/lib-engine/src/testUtil/TalonRepl.ts index 1cec66f868..d70b5a2192 100644 --- a/packages/lib-engine/src/testUtil/TalonRepl.ts +++ b/packages/lib-engine/src/testUtil/TalonRepl.ts @@ -1,6 +1,6 @@ -import { isWindows } from "@cursorless/lib-node-common"; import * as childProcess from "node:child_process"; import * as os from "node:os"; +import { isWindows } from "@cursorless/lib-node-common"; const MAX_OUTPUT_TO_EAT = 20; diff --git a/packages/lib-engine/src/testUtil/TestFileSystem.ts b/packages/lib-engine/src/testUtil/TestFileSystem.ts index caf4ecf45b..58065bdac8 100644 --- a/packages/lib-engine/src/testUtil/TestFileSystem.ts +++ b/packages/lib-engine/src/testUtil/TestFileSystem.ts @@ -1,3 +1,5 @@ +import fs from "node:fs/promises"; +import { join } from "node:path"; import type { Disposable, FileSystem, @@ -5,8 +7,6 @@ import type { RunMode, } from "@cursorless/lib-common"; import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; -import { join } from "node:path"; -import fs from "node:fs/promises"; export class TestFileSystem implements FileSystem { public readonly cursorlessTalonStateJsonPath: string; diff --git a/packages/lib-engine/src/testUtil/TestTreeSitter.ts b/packages/lib-engine/src/testUtil/TestTreeSitter.ts index 42cb15ec59..54e425da14 100644 --- a/packages/lib-engine/src/testUtil/TestTreeSitter.ts +++ b/packages/lib-engine/src/testUtil/TestTreeSitter.ts @@ -1,8 +1,8 @@ -import type { TextDocument, TreeSitter } from "@cursorless/lib-common"; import * as path from "node:path"; -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import type { Tree } from "web-tree-sitter"; import { Parser, Query, Language } from "web-tree-sitter"; +import type { TextDocument, TreeSitter } from "@cursorless/lib-common"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; interface LanguageConf { language: Language; diff --git a/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts b/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts index f308ca5e7c..caced53d5e 100644 --- a/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts +++ b/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts @@ -1,6 +1,6 @@ +import * as assert from "node:assert/strict"; import type { TokenHatSplittingMode } from "@cursorless/lib-common"; import { FakeIDE } from "@cursorless/lib-common"; -import * as assert from "node:assert/strict"; import { TokenGraphemeSplitter, UNKNOWN } from "./tokenGraphemeSplitter"; /** diff --git a/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts b/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts index bf0711bd8a..b12ff8616d 100644 --- a/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts +++ b/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts @@ -1,10 +1,10 @@ +import { deburr, escapeRegExp } from "lodash-es"; import type { Disposable, IDE, TokenHatSplittingMode, } from "@cursorless/lib-common"; import { Notifier, matchAll } from "@cursorless/lib-common"; -import { deburr, escapeRegExp } from "lodash-es"; /** * A list of all symbols that are speakable by default in community. diff --git a/packages/lib-engine/src/tokenizer/tokenizer.test.ts b/packages/lib-engine/src/tokenizer/tokenizer.test.ts index 50714cdaf9..2fd44b0f41 100644 --- a/packages/lib-engine/src/tokenizer/tokenizer.test.ts +++ b/packages/lib-engine/src/tokenizer/tokenizer.test.ts @@ -1,7 +1,7 @@ import * as assert from "node:assert/strict"; import { flatten, range } from "lodash-es"; -import { tokenize } from "."; import { FakeIDE } from "@cursorless/lib-common"; +import { tokenize } from "."; type TestCase = [string, string[]]; /** diff --git a/packages/lib-engine/src/tokenizer/tokenizer.ts b/packages/lib-engine/src/tokenizer/tokenizer.ts index f4b5ff44ff..03464af1cb 100644 --- a/packages/lib-engine/src/tokenizer/tokenizer.ts +++ b/packages/lib-engine/src/tokenizer/tokenizer.ts @@ -1,5 +1,5 @@ -import { matchAll, type IDE } from "@cursorless/lib-common"; import { escapeRegExp } from "lodash-es"; +import { matchAll, type IDE } from "@cursorless/lib-common"; import type { LanguageTokenizerComponents } from "./tokenizer.types"; const REPEATABLE_SYMBOLS = [ diff --git a/packages/lib-engine/src/typings/Types.ts b/packages/lib-engine/src/typings/Types.ts index 010ecc3b67..7176a4404a 100644 --- a/packages/lib-engine/src/typings/Types.ts +++ b/packages/lib-engine/src/typings/Types.ts @@ -1,10 +1,10 @@ +import type { Node } from "web-tree-sitter"; import type { Edit, Range, Selection, TextEditor, } from "@cursorless/lib-common"; -import type { Node } from "web-tree-sitter"; export interface SelectionWithEditor { selection: Selection; diff --git a/packages/lib-engine/src/typings/target.types.ts b/packages/lib-engine/src/typings/target.types.ts index a2f3fde378..c3de33b1bc 100644 --- a/packages/lib-engine/src/typings/target.types.ts +++ b/packages/lib-engine/src/typings/target.types.ts @@ -3,8 +3,6 @@ // switch to `{import("foo")}` syntax in the `{@link}` tag. // - https://github.com/microsoft/TypeScript/issues/43869 // - https://github.com/microsoft/TypeScript/issues/43950 -// oxlint-disable-next-line no-unused-vars -import type { ModifyIfUntypedStage } from "../processTargets/modifiers/ConditionalModifierStages"; import type { GeneralizedRange, InsertionMode, @@ -17,6 +15,8 @@ import type { TargetPlainObject, TextEditor, } from "@cursorless/lib-common"; +// oxlint-disable-next-line no-unused-vars +import type { ModifyIfUntypedStage } from "../processTargets/modifiers/ConditionalModifierStages"; import type { // oxlint-disable-next-line @typescript-eslint/no-unused-vars ScopeTypeTarget, diff --git a/packages/lib-engine/src/util/allocateHats/HatMetrics.ts b/packages/lib-engine/src/util/allocateHats/HatMetrics.ts index c17f7c19b6..e9718f12ae 100644 --- a/packages/lib-engine/src/util/allocateHats/HatMetrics.ts +++ b/packages/lib-engine/src/util/allocateHats/HatMetrics.ts @@ -1,6 +1,6 @@ +import { memoize, min } from "lodash-es"; import type { CompositeKeyMap, TokenHat } from "@cursorless/lib-common"; import { HatStability } from "@cursorless/lib-common"; -import { memoize, min } from "lodash-es"; import type { HatCandidate } from "./allocateHats"; /** diff --git a/packages/lib-engine/src/util/allocateHats/getDisplayLineMap.ts b/packages/lib-engine/src/util/allocateHats/getDisplayLineMap.ts index f8678374db..db579d44d6 100644 --- a/packages/lib-engine/src/util/allocateHats/getDisplayLineMap.ts +++ b/packages/lib-engine/src/util/allocateHats/getDisplayLineMap.ts @@ -1,5 +1,5 @@ -import type { TextEditor } from "@cursorless/lib-common"; import { range, uniq } from "lodash-es"; +import type { TextEditor } from "@cursorless/lib-common"; /** * Returns a map from line numbers in the file to display lines, which skip diff --git a/packages/lib-engine/src/util/allocateHats/getRankedTokens.ts b/packages/lib-engine/src/util/allocateHats/getRankedTokens.ts index ba06f8ec5c..88a9553a67 100644 --- a/packages/lib-engine/src/util/allocateHats/getRankedTokens.ts +++ b/packages/lib-engine/src/util/allocateHats/getRankedTokens.ts @@ -1,3 +1,4 @@ +import { flatten } from "lodash-es"; import type { CompositeKeyMap, IDE, @@ -5,7 +6,6 @@ import type { Token, TokenHat, } from "@cursorless/lib-common"; -import { flatten } from "lodash-es"; import { getDisplayLineMap } from "./getDisplayLineMap"; import { getTokenComparator } from "./getTokenComparator"; import { getTokensInRange } from "./getTokensInRange"; diff --git a/packages/lib-engine/src/util/getMatchesInRange.ts b/packages/lib-engine/src/util/getMatchesInRange.ts index 1428908e4e..9103897433 100644 --- a/packages/lib-engine/src/util/getMatchesInRange.ts +++ b/packages/lib-engine/src/util/getMatchesInRange.ts @@ -1,6 +1,6 @@ +import { imap } from "itertools"; import type { Direction, TextEditor } from "@cursorless/lib-common"; import { matchAll, Range } from "@cursorless/lib-common"; -import { imap } from "itertools"; export function getMatchesInRange( regex: RegExp, diff --git a/packages/lib-engine/src/util/targetUtils.ts b/packages/lib-engine/src/util/targetUtils.ts index 859288c2eb..74afe73626 100644 --- a/packages/lib-engine/src/util/targetUtils.ts +++ b/packages/lib-engine/src/util/targetUtils.ts @@ -1,3 +1,4 @@ +import { zip } from "lodash-es"; import type { FlashStyle, GeneralizedRange, @@ -11,7 +12,6 @@ import { toCharacterRange, toLineRange, } from "@cursorless/lib-common"; -import { zip } from "lodash-es"; import type { Destination, Target } from "../typings/target.types"; import type { SelectionWithEditor } from "../typings/Types"; diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimClipboard.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimClipboard.ts index 1156cfc780..16ef08e6ce 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimClipboard.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimClipboard.ts @@ -1,6 +1,6 @@ +import type { NeovimClient } from "neovim"; import type { Clipboard } from "@cursorless/lib-common"; import { getClipboard, setClipboard } from "../../neovimApi"; -import type { NeovimClient } from "neovim"; export default class NeovimClipboard implements Clipboard { constructor(private client: NeovimClient) {} diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimConfiguration.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimConfiguration.ts index a9076b1845..26969f1f90 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimConfiguration.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimConfiguration.ts @@ -1,3 +1,4 @@ +import { get } from "lodash"; import type { Configuration, ConfigurationScope, @@ -7,7 +8,6 @@ import type { Paths, } from "@cursorless/lib-common"; import { CONFIGURATION_DEFAULTS, Notifier } from "@cursorless/lib-common"; -import { get } from "lodash"; interface ConfigurationScopeValues { scope: ConfigurationScope; diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimEdit.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimEdit.ts index 68d6182a1b..879975ede6 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimEdit.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimEdit.ts @@ -1,3 +1,4 @@ +import type { NeovimClient, Window } from "neovim"; import type { Edit, Position, @@ -5,9 +6,8 @@ import type { TextDocument, TextDocumentContentChangeEvent, } from "@cursorless/lib-common"; -import type { NeovimClient, Window } from "neovim"; -import type { NeovimIDE } from "./NeovimIDE"; import { getNeovimRegistry } from "@cursorless/lib-neovim-registry"; +import type { NeovimIDE } from "./NeovimIDE"; export default async function neovimEdit( client: NeovimClient, diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimEvents.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimEvents.ts index 6f185f5652..0c12220d47 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimEvents.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimEvents.ts @@ -1,3 +1,4 @@ +import type { Buffer } from "neovim"; import type { Disposable, TextDocument, @@ -7,8 +8,6 @@ import type { import { Position, Range } from "@cursorless/lib-common"; import { getNeovimRegistry } from "@cursorless/lib-neovim-registry"; -import type { Buffer } from "neovim"; - export function neovimOnDidChangeTextDocument( listener: (event: TextDocumentChangeEvent) => void, ): Disposable { diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts index 84ec004979..024bcafcad 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts @@ -1,3 +1,8 @@ +import * as path from "node:path"; +import { pull } from "lodash"; +import type { Buffer, NeovimClient, Window } from "neovim"; +import { v4 as uuid } from "uuid"; +import { URI } from "vscode-uri"; import type { Disposable, EditableTextEditor, @@ -18,31 +23,25 @@ import type { TextEditorVisibleRangesChangeEvent, WorkspaceFolder, } from "@cursorless/lib-common"; -import { nodeGetRunMode } from "@cursorless/lib-node-common"; -import { pull } from "lodash"; -import type { Buffer, NeovimClient, Window } from "neovim"; -import * as path from "node:path"; -import { v4 as uuid } from "uuid"; -import { URI } from "vscode-uri"; -import { NeovimCapabilities } from "./NeovimCapabilities"; -import NeovimClipboard from "./NeovimClipboard"; -import NeovimConfiguration from "./NeovimConfiguration"; -import NeovimKeyValueStore from "./NeovimKeyValueStore"; -import NeovimMessages from "./NeovimMessages"; -import { NeovimTextEditor } from "./NeovimTextEditor"; - import { getNeovimRegistry } from "@cursorless/lib-neovim-registry"; +import { nodeGetRunMode } from "@cursorless/lib-node-common"; import { bufferGetSelections, getCursorlessNvimPath, showErrorMessage, windowGetVisibleRanges, } from "../../neovimApi"; +import { NeovimCapabilities } from "./NeovimCapabilities"; +import NeovimClipboard from "./NeovimClipboard"; +import NeovimConfiguration from "./NeovimConfiguration"; import { neovimOnDidChangeTextDocument, neovimOnDidOpenTextDocument, } from "./NeovimEvents"; +import NeovimKeyValueStore from "./NeovimKeyValueStore"; +import NeovimMessages from "./NeovimMessages"; import { NeovimTextDocument } from "./NeovimTextDocument"; +import { NeovimTextEditor } from "./NeovimTextEditor"; export class NeovimIDE implements IDE { readonly configuration: NeovimConfiguration; diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimTextDocument.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimTextDocument.ts index 9b2345436f..2f5be6254b 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimTextDocument.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimTextDocument.ts @@ -1,8 +1,8 @@ +import path from "node:path"; +import type { URI } from "vscode-uri"; import type { EndOfLine, TextDocument, TextLine } from "@cursorless/lib-common"; import { Position, Range } from "@cursorless/lib-common"; -import type { URI } from "vscode-uri"; import NeovimTextLine from "./NeovimTextLine"; -import path from "node:path"; export class NeovimTextDocument implements TextDocument { private _uri: URI; diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimTextEditor.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimTextEditor.ts index c73cbca336..3be77d3127 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimTextEditor.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimTextEditor.ts @@ -1,3 +1,4 @@ +import type { NeovimClient, Window } from "neovim"; import type { Edit, EditableTextEditor, @@ -9,7 +10,6 @@ import type { TextEditor, TextEditorOptions, } from "@cursorless/lib-common"; -import type { NeovimClient, Window } from "neovim"; import { bufferSetSelections } from "../../neovimApi"; import { neovimClipboardCopy, neovimClipboardPaste } from "../../neovimHelpers"; import neovimEdit from "./NeovimEdit"; diff --git a/packages/lib-neovim-common/src/neovimApi.ts b/packages/lib-neovim-common/src/neovimApi.ts index c017da4387..461034581f 100644 --- a/packages/lib-neovim-common/src/neovimApi.ts +++ b/packages/lib-neovim-common/src/neovimApi.ts @@ -1,7 +1,7 @@ // Helper directly calling into Neovim apis, generally lua, exported by cursorless.nvim -import { Position, Range, Selection } from "@cursorless/lib-common"; import type { NeovimClient } from "neovim/lib/api/client"; import type { Window } from "neovim/lib/api/Window"; +import { Position, Range, Selection } from "@cursorless/lib-common"; /** * Get the current "selections" in the window(editor) diff --git a/packages/lib-neovim-common/src/neovimHelpers.ts b/packages/lib-neovim-common/src/neovimHelpers.ts index b477aa9687..c6ff8eeb32 100644 --- a/packages/lib-neovim-common/src/neovimHelpers.ts +++ b/packages/lib-neovim-common/src/neovimHelpers.ts @@ -1,13 +1,13 @@ // Helper wrappers, generally around neovimApi.ts +import type { NeovimClient } from "neovim"; +import type { IDE } from "@cursorless/lib-common"; import { bufferGetSelections, pasteFromClipboard, setClipboard, } from "@cursorless/lib-neovim-common"; import type { NeovimTextEditor } from "./ide/neovim/NeovimTextEditor"; -import type { NeovimClient } from "neovim"; -import type { IDE } from "@cursorless/lib-common"; export async function neovimClipboardCopy( client: NeovimClient, diff --git a/packages/lib-node-common/src/Cheatsheet.ts b/packages/lib-node-common/src/Cheatsheet.ts index 1ee2ee21ee..db71394ca7 100644 --- a/packages/lib-node-common/src/Cheatsheet.ts +++ b/packages/lib-node-common/src/Cheatsheet.ts @@ -1,10 +1,10 @@ -import { type IDE } from "@cursorless/lib-common"; -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import { readFile, writeFile } from "node:fs/promises"; +import * as path from "node:path"; import { produce } from "immer"; import { sortBy } from "lodash-es"; import { parse } from "node-html-parser"; -import * as path from "node:path"; +import { type IDE } from "@cursorless/lib-common"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; /** * The argument expected by the cheatsheet command. diff --git a/packages/lib-node-common/src/FileSystemCommandHistoryStorage.ts b/packages/lib-node-common/src/FileSystemCommandHistoryStorage.ts index 512342cfa2..2802ab8c06 100644 --- a/packages/lib-node-common/src/FileSystemCommandHistoryStorage.ts +++ b/packages/lib-node-common/src/FileSystemCommandHistoryStorage.ts @@ -1,10 +1,10 @@ +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +import glob from "fast-glob"; import type { CommandHistoryEntry, CommandHistoryStorage, } from "@cursorless/lib-common"; -import glob from "fast-glob"; -import * as fs from "node:fs/promises"; -import * as path from "node:path"; export class FileSystemCommandHistoryStorage implements CommandHistoryStorage { constructor(private dir: string) {} diff --git a/packages/lib-node-common/src/FileSystemRawTreeSitterQueryProvider.ts b/packages/lib-node-common/src/FileSystemRawTreeSitterQueryProvider.ts index 5323c31ff7..3c82fb424f 100644 --- a/packages/lib-node-common/src/FileSystemRawTreeSitterQueryProvider.ts +++ b/packages/lib-node-common/src/FileSystemRawTreeSitterQueryProvider.ts @@ -1,3 +1,4 @@ +import * as path from "node:path"; import { Notifier, type Disposable, @@ -5,7 +6,6 @@ import { type IDE, type RawTreeSitterQueryProvider, } from "@cursorless/lib-common"; -import * as path from "node:path"; import { getCursorlessRepoRoot } from "./getCursorlessRepoRoot"; export class FileSystemRawTreeSitterQueryProvider implements RawTreeSitterQueryProvider { diff --git a/packages/lib-node-common/src/FileSystemTalonSpokenForms.ts b/packages/lib-node-common/src/FileSystemTalonSpokenForms.ts index 51531ae8d5..fa2a7b1e81 100644 --- a/packages/lib-node-common/src/FileSystemTalonSpokenForms.ts +++ b/packages/lib-node-common/src/FileSystemTalonSpokenForms.ts @@ -1,3 +1,5 @@ +import { readFile } from "node:fs/promises"; +import * as path from "node:path"; import type { Disposable, FileSystem, @@ -6,8 +8,6 @@ import type { TalonSpokenForms, } from "@cursorless/lib-common"; import { NeedsInitialTalonUpdateError, Notifier } from "@cursorless/lib-common"; -import { readFile } from "node:fs/promises"; -import * as path from "node:path"; interface TalonSpokenFormsPayload { version: number; diff --git a/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts b/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts index 6b5f83a376..8c12ee337e 100644 --- a/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts +++ b/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts @@ -1,10 +1,10 @@ +import { readFile, readdir } from "node:fs/promises"; +import * as path from "node:path"; import type { RawTutorialContent, TutorialContentProvider, TutorialId, } from "@cursorless/lib-common"; -import { readFile, readdir } from "node:fs/promises"; -import * as path from "node:path"; import { loadFixture } from "./loadFixture"; export class FileSystemTutorialContentProvider implements TutorialContentProvider { diff --git a/packages/lib-node-common/src/getFixturePaths.ts b/packages/lib-node-common/src/getFixturePaths.ts index b73d30a350..63f1cd05ee 100644 --- a/packages/lib-node-common/src/getFixturePaths.ts +++ b/packages/lib-node-common/src/getFixturePaths.ts @@ -1,9 +1,9 @@ +import * as path from "node:path"; import type { PlaintextScopeSupportFacet, ScopeSupportFacet, } from "@cursorless/lib-common"; import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; -import * as path from "node:path"; import { walkFilesSync } from "./walkSync"; export function getFixturesPath() { diff --git a/packages/lib-node-common/src/loadFixture.ts b/packages/lib-node-common/src/loadFixture.ts index e51ac44d65..6d6250f548 100644 --- a/packages/lib-node-common/src/loadFixture.ts +++ b/packages/lib-node-common/src/loadFixture.ts @@ -1,5 +1,5 @@ -import * as yaml from "js-yaml"; import { readFile } from "node:fs/promises"; +import * as yaml from "js-yaml"; import type { TestCaseFixtureLegacy } from "@cursorless/lib-common"; export async function loadFixture( diff --git a/packages/lib-node-common/src/runRecordedTest.ts b/packages/lib-node-common/src/runRecordedTest.ts index cdb10b0b50..ca12cb6b1b 100644 --- a/packages/lib-node-common/src/runRecordedTest.ts +++ b/packages/lib-node-common/src/runRecordedTest.ts @@ -1,3 +1,6 @@ +import * as assert from "node:assert/strict"; +import { promises as fsp } from "node:fs"; +import { isUndefined } from "lodash-es"; import type { Command, CommandResponse, @@ -25,9 +28,6 @@ import { spyIDERecordedValuesToPlainObject, storedTargetKeys, } from "@cursorless/lib-common"; -import { isUndefined } from "lodash-es"; -import * as assert from "node:assert/strict"; -import { promises as fsp } from "node:fs"; import { loadFixture } from "./loadFixture"; function createPosition(position: PositionPlainObject) { diff --git a/packages/lib-node-common/src/walkAsync.ts b/packages/lib-node-common/src/walkAsync.ts index 4333a34060..fd0374acdc 100644 --- a/packages/lib-node-common/src/walkAsync.ts +++ b/packages/lib-node-common/src/walkAsync.ts @@ -1,5 +1,5 @@ -import * as path from "node:path"; import { readdir } from "node:fs/promises"; +import * as path from "node:path"; import { flatten } from "lodash-es"; /** diff --git a/packages/lib-node-common/src/walkSync.ts b/packages/lib-node-common/src/walkSync.ts index 7ed4e0ab91..91caafb5ef 100644 --- a/packages/lib-node-common/src/walkSync.ts +++ b/packages/lib-node-common/src/walkSync.ts @@ -1,5 +1,5 @@ -import * as path from "node:path"; import { readdirSync } from "node:fs"; +import * as path from "node:path"; /** * Note: Returns full paths diff --git a/packages/lib-sentence-parser/src/sbd.ts b/packages/lib-sentence-parser/src/sbd.ts index 08a1f03cb1..f8502a1e3b 100644 --- a/packages/lib-sentence-parser/src/sbd.ts +++ b/packages/lib-sentence-parser/src/sbd.ts @@ -1,5 +1,5 @@ -import * as stringHelper from "./stringHelper"; import * as Match from "./Match"; +import * as stringHelper from "./stringHelper"; const newline_placeholder = " @~@ "; const newline_placeholder_t = newline_placeholder.trim(); diff --git a/packages/lib-talonjs-core/src/extension.ts b/packages/lib-talonjs-core/src/extension.ts index 7f30b46a95..0a7c6aaba3 100644 --- a/packages/lib-talonjs-core/src/extension.ts +++ b/packages/lib-talonjs-core/src/extension.ts @@ -1,5 +1,4 @@ import "./polyfill"; - import type { RunMode } from "@cursorless/lib-common"; import { FakeCommandServerApi, diff --git a/packages/lib-talonjs-core/src/ide/TalonJsIDE.ts b/packages/lib-talonjs-core/src/ide/TalonJsIDE.ts index d43995e31a..66e549771b 100644 --- a/packages/lib-talonjs-core/src/ide/TalonJsIDE.ts +++ b/packages/lib-talonjs-core/src/ide/TalonJsIDE.ts @@ -1,3 +1,4 @@ +import { pull } from "lodash-es"; import type { Capabilities, Clipboard, @@ -23,7 +24,6 @@ import type { WorkspaceFolder, } from "@cursorless/lib-common"; import { InMemoryTextEditor, Notifier } from "@cursorless/lib-common"; -import { pull } from "lodash-es"; import type { Talon } from "../types/talon"; import type { EditorEdit, EditorState } from "../types/types"; import { flashRanges } from "./flashRanges"; diff --git a/packages/lib-test-case-recorder/src/ScopeTestRecorder.ts b/packages/lib-test-case-recorder/src/ScopeTestRecorder.ts index ff16f66c28..a66e07fd46 100644 --- a/packages/lib-test-case-recorder/src/ScopeTestRecorder.ts +++ b/packages/lib-test-case-recorder/src/ScopeTestRecorder.ts @@ -1,3 +1,6 @@ +import * as fs from "node:fs"; +import * as fsPromises from "node:fs/promises"; +import * as path from "node:path"; import { ScopeSupportFacetLevel, groupBy, @@ -11,9 +14,6 @@ import { getScopeTestPathsRecursively, getScopeTestsDirPath, } from "@cursorless/lib-node-common"; -import * as fs from "node:fs"; -import * as fsPromises from "node:fs/promises"; -import * as path from "node:path"; export class ScopeTestRecorder { constructor(private ide: IDE) { diff --git a/packages/lib-test-case-recorder/src/TestCase.ts b/packages/lib-test-case-recorder/src/TestCase.ts index a2ef42c855..360af8d9d5 100644 --- a/packages/lib-test-case-recorder/src/TestCase.ts +++ b/packages/lib-test-case-recorder/src/TestCase.ts @@ -1,3 +1,4 @@ +import { pick } from "lodash-es"; import type { ActionType, CommandLatest, @@ -28,7 +29,6 @@ import { getPartialTargetDescriptors, type StoredTargetMap, } from "@cursorless/lib-engine"; -import { pick } from "lodash-es"; import { takeSnapshot } from "./takeSnapshot"; export class TestCase { diff --git a/packages/lib-test-case-recorder/src/TestCaseRecorder.ts b/packages/lib-test-case-recorder/src/TestCaseRecorder.ts index f1a6862344..8f6963036d 100644 --- a/packages/lib-test-case-recorder/src/TestCaseRecorder.ts +++ b/packages/lib-test-case-recorder/src/TestCaseRecorder.ts @@ -1,3 +1,8 @@ +import * as fs from "node:fs"; +import { access, readFile, unlink } from "node:fs/promises"; +import * as path from "node:path"; +import { invariant } from "immutability-helper"; +import { merge } from "lodash-es"; import type { CommandComplete, CommandLatest, @@ -33,11 +38,6 @@ import { getRecordedTestsDirPath, walkDirsSync, } from "@cursorless/lib-node-common"; -import { invariant } from "immutability-helper"; -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 type { RecordTestCaseCommandOptions } from "./RecordTestCaseCommandOptions"; import { takeSnapshot } from "./takeSnapshot"; import { TestCase } from "./TestCase"; diff --git a/packages/lib-tutorial/src/TutorialImpl.ts b/packages/lib-tutorial/src/TutorialImpl.ts index d37ef19179..a62cbcee86 100644 --- a/packages/lib-tutorial/src/TutorialImpl.ts +++ b/packages/lib-tutorial/src/TutorialImpl.ts @@ -1,3 +1,5 @@ +import { produce } from "immer"; +import { isEqual } from "lodash-es"; import type { CharacterRange, Disposable, @@ -18,14 +20,12 @@ import type { CommandRunnerDecorator, CustomSpokenFormGenerator, } from "@cursorless/lib-engine"; -import { produce } from "immer"; -import { isEqual } from "lodash-es"; import { arePreconditionsMet } from "./arePreconditionsMet"; import { loadTutorial } from "./loadTutorial"; import { setupStep } from "./setupStep"; +import type { Tutorial } from "./Tutorial"; import { tutorialWrapCommandRunner } from "./tutorialWrapCommandRunner"; import type { TutorialContent } from "./types/tutorial.types"; -import type { Tutorial } from "./Tutorial"; const HIGHLIGHT_COLOR = "highlight0"; diff --git a/packages/lib-tutorial/src/arePreconditionsMet.ts b/packages/lib-tutorial/src/arePreconditionsMet.ts index e63cd7b592..90db59e392 100644 --- a/packages/lib-tutorial/src/arePreconditionsMet.ts +++ b/packages/lib-tutorial/src/arePreconditionsMet.ts @@ -1,9 +1,9 @@ +import { isEqual } from "lodash-es"; import type { HatTokenMap, TextEditor } from "@cursorless/lib-common"; import { plainObjectToSelection, serializedMarksToTokenHats, } from "@cursorless/lib-common"; -import { isEqual } from "lodash-es"; import type { TutorialStep } from "./types/tutorial.types"; /** diff --git a/packages/lib-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts b/packages/lib-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts index c882cf730a..fae36e3eda 100644 --- a/packages/lib-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts +++ b/packages/lib-tutorial/src/stepComponentParsers/CursorlessCommandComponentParser.ts @@ -1,3 +1,5 @@ +import { produce } from "immer"; +import { cloneDeep, mapKeys } from "lodash-es"; import type { CommandComplete, CommandLatest, @@ -19,8 +21,6 @@ import type { StepComponent, StepComponentParser, } from "../types/StepComponent"; -import { cloneDeep, mapKeys } from "lodash-es"; -import { produce } from "immer"; /** * Parses components of the form `{command:takeNear.yml}`. The argument diff --git a/packages/lib-tutorial/src/stepComponentParsers/parseSpecialComponent.ts b/packages/lib-tutorial/src/stepComponentParsers/parseSpecialComponent.ts index 3d9c1a9af4..e030e39fb7 100644 --- a/packages/lib-tutorial/src/stepComponentParsers/parseSpecialComponent.ts +++ b/packages/lib-tutorial/src/stepComponentParsers/parseSpecialComponent.ts @@ -1,5 +1,5 @@ -import type { TutorialStepTrigger } from "../types/TutorialStepTrigger"; import type { StepComponent } from "../types/StepComponent"; +import type { TutorialStepTrigger } from "../types/TutorialStepTrigger"; const SPECIAL_COMMANDS = { help: "cursorless help", diff --git a/packages/lib-tutorial/src/tutorialWrapCommandRunner.ts b/packages/lib-tutorial/src/tutorialWrapCommandRunner.ts index b927e14eb0..e8f33132a8 100644 --- a/packages/lib-tutorial/src/tutorialWrapCommandRunner.ts +++ b/packages/lib-tutorial/src/tutorialWrapCommandRunner.ts @@ -1,8 +1,8 @@ +import { isEqual } from "lodash-es"; import type { CommandComplete } from "@cursorless/lib-common"; import type { CommandRunner } from "@cursorless/lib-engine"; -import { isEqual } from "lodash-es"; -import type { TutorialContent } from "./types/tutorial.types"; import type { Tutorial } from "./Tutorial"; +import type { TutorialContent } from "./types/tutorial.types"; /** * If the tutorial is currently active and we are in a step that is waiting diff --git a/packages/lib-vscode-common/src/TestHelpers.ts b/packages/lib-vscode-common/src/TestHelpers.ts index 6bc6903ee1..391be78beb 100644 --- a/packages/lib-vscode-common/src/TestHelpers.ts +++ b/packages/lib-vscode-common/src/TestHelpers.ts @@ -1,3 +1,4 @@ +import type * as vscode from "vscode"; import type { IDE, NormalizedIDE, @@ -5,9 +6,8 @@ import type { TestHelpers, TextEditor, } from "@cursorless/lib-common"; -import type * as vscode from "vscode"; -import type { VscodeApi } from "./VscodeApi"; import type { SpyWebViewEvent } from "./SpyWebViewEvent"; +import type { VscodeApi } from "./VscodeApi"; export interface VscodeTestHelpers extends TestHelpers { ide: NormalizedIDE; diff --git a/packages/lib-vscode-common/src/getExtensionApi.ts b/packages/lib-vscode-common/src/getExtensionApi.ts index ee47878f70..5813c41d15 100644 --- a/packages/lib-vscode-common/src/getExtensionApi.ts +++ b/packages/lib-vscode-common/src/getExtensionApi.ts @@ -1,6 +1,6 @@ -import type { CommandServerApi } from "@cursorless/lib-common"; import * as vscode from "vscode"; import type { Query, Tree } from "web-tree-sitter"; +import type { CommandServerApi } from "@cursorless/lib-common"; import type { VscodeTestHelpers } from "./TestHelpers"; export interface CursorlessApi { diff --git a/packages/lib-vscode-common/src/runCommand.ts b/packages/lib-vscode-common/src/runCommand.ts index 1ae517af59..e7b298889f 100644 --- a/packages/lib-vscode-common/src/runCommand.ts +++ b/packages/lib-vscode-common/src/runCommand.ts @@ -1,10 +1,10 @@ +import * as vscode from "vscode"; import type { ActionDescriptor, Command, CommandResponse, } from "@cursorless/lib-common"; import { CURSORLESS_COMMAND_ID, LATEST_VERSION } from "@cursorless/lib-common"; -import * as vscode from "vscode"; export async function runCursorlessCommand( command: Command, diff --git a/packages/lib-vscode-common/src/vscodeUtil.ts b/packages/lib-vscode-common/src/vscodeUtil.ts index 0b8a4e8ee2..1b9145525b 100644 --- a/packages/lib-vscode-common/src/vscodeUtil.ts +++ b/packages/lib-vscode-common/src/vscodeUtil.ts @@ -1,6 +1,6 @@ +import * as vscode from "vscode"; import type { EndOfLine } from "@cursorless/lib-common"; import { Position, Range, Selection } from "@cursorless/lib-common"; -import * as vscode from "vscode"; export function toVscodeRange(range: Range): vscode.Range { return new vscode.Range( diff --git a/packages/lib-vscode-tutorial-webview/src/App.tsx b/packages/lib-vscode-tutorial-webview/src/App.tsx index 5fb2e025da..4bb881944c 100644 --- a/packages/lib-vscode-tutorial-webview/src/App.tsx +++ b/packages/lib-vscode-tutorial-webview/src/App.tsx @@ -1,6 +1,6 @@ -import type { TutorialState } from "@cursorless/lib-common"; import { useEffect, useState } from "preact/hooks"; import type { WebviewApi } from "vscode-webview"; +import type { TutorialState } from "@cursorless/lib-common"; import { Command } from "./Command"; import { TutorialStep } from "./TutorialStep"; diff --git a/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx b/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx index 01d7c0bc0e..a5a02d037a 100644 --- a/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx +++ b/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx @@ -1,5 +1,5 @@ -import type { ActiveTutorialNoErrorsState } from "@cursorless/lib-common"; import type { WebviewApi } from "vscode-webview"; +import type { ActiveTutorialNoErrorsState } from "@cursorless/lib-common"; import { ArrowLeftIcon } from "./ArrowLeftIcon"; import { ArrowRightIcon } from "./ArrowRightIcon"; import { CloseIcon } from "./CloseIcon"; diff --git a/packages/lib-vscode-tutorial-webview/vite.config.ts b/packages/lib-vscode-tutorial-webview/vite.config.ts index 0495d2eb31..f33304c462 100644 --- a/packages/lib-vscode-tutorial-webview/vite.config.ts +++ b/packages/lib-vscode-tutorial-webview/vite.config.ts @@ -1,6 +1,6 @@ -import { vitePreactAlias } from "@cursorless/lib-common/vite"; import { defineConfig, type UserConfig } from "vite"; import purgeCss from "vite-plugin-purgecss"; +import { vitePreactAlias } from "@cursorless/lib-common/vite"; export default defineConfig((): UserConfig => { return { diff --git a/packages/test-neovim-e2e/src/endToEndTestSetup.ts b/packages/test-neovim-e2e/src/endToEndTestSetup.ts index 899ae522cc..f13df6aeeb 100644 --- a/packages/test-neovim-e2e/src/endToEndTestSetup.ts +++ b/packages/test-neovim-e2e/src/endToEndTestSetup.ts @@ -1,9 +1,9 @@ +import type { Context } from "mocha"; +import * as sinon from "sinon"; import type { IDE } from "@cursorless/lib-common"; import { shouldUpdateFixtures, sleep, SpyIDE } from "@cursorless/lib-common"; import type { NeovimIDE } from "@cursorless/lib-neovim-common"; import { getCursorlessApi } from "@cursorless/lib-neovim-common"; -import type { Context } from "mocha"; -import * as sinon from "sinon"; /** * The number of times the current test has been retried. Will be 0 the first diff --git a/packages/test-neovim-e2e/src/suite/recorded.neovim.test.ts b/packages/test-neovim-e2e/src/suite/recorded.neovim.test.ts index d9a3a5192e..61ec94c54a 100644 --- a/packages/test-neovim-e2e/src/suite/recorded.neovim.test.ts +++ b/packages/test-neovim-e2e/src/suite/recorded.neovim.test.ts @@ -1,9 +1,8 @@ +import { promises as fsp } from "node:fs"; +import * as yaml from "js-yaml"; +import type { NeovimClient } from "neovim"; import type { TestCaseFixtureLegacy } from "@cursorless/lib-common"; import { asyncSafety } from "@cursorless/lib-common"; -import { - getRecordedTestPaths, - runRecordedTest, -} from "@cursorless/lib-node-common"; import type { NeovimIDE, NeovimTextEditor, @@ -13,9 +12,10 @@ import { getCursorlessApi, runCursorlessCommand, } from "@cursorless/lib-neovim-common"; -import * as yaml from "js-yaml"; -import type { NeovimClient } from "neovim"; -import { promises as fsp } from "node:fs"; +import { + getRecordedTestPaths, + runRecordedTest, +} from "@cursorless/lib-node-common"; import { endToEndTestSetup, sleepWithBackoff } from "../endToEndTestSetup"; import { shouldRunTest } from "../shouldRunTest"; diff --git a/packages/test-runner/src/launchNeovimAndRunTests.ts b/packages/test-runner/src/launchNeovimAndRunTests.ts index a206ea999a..8602dc0202 100644 --- a/packages/test-runner/src/launchNeovimAndRunTests.ts +++ b/packages/test-runner/src/launchNeovimAndRunTests.ts @@ -1,9 +1,9 @@ -import { getEnvironmentVariableStrict } from "@cursorless/lib-common"; -import { getCursorlessRepoRoot, isWindows } from "@cursorless/lib-node-common"; import * as cp from "node:child_process"; import { copyFile, mkdirSync, readdirSync } from "node:fs"; import process from "node:process"; import { Tail } from "tail"; +import { getEnvironmentVariableStrict } from "@cursorless/lib-common"; +import { getCursorlessRepoRoot, isWindows } from "@cursorless/lib-node-common"; /** * Launches neovim, instructing it to run the test runner diff --git a/packages/test-runner/src/launchVscodeAndRunTests.ts b/packages/test-runner/src/launchVscodeAndRunTests.ts index cf05e798b1..6bbf64889b 100644 --- a/packages/test-runner/src/launchVscodeAndRunTests.ts +++ b/packages/test-runner/src/launchVscodeAndRunTests.ts @@ -1,15 +1,15 @@ -import { - extensionDependencies, - getEnvironmentVariableStrict, -} from "@cursorless/lib-common"; -import { getCursorlessRepoRoot, isWindows } from "@cursorless/lib-node-common"; +import * as path from "node:path"; import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests, } from "@vscode/test-electron"; import { sync } from "cross-spawn"; -import * as path from "node:path"; +import { + extensionDependencies, + getEnvironmentVariableStrict, +} from "@cursorless/lib-common"; +import { getCursorlessRepoRoot, isWindows } from "@cursorless/lib-node-common"; /** * Downloads and launches VSCode, instructing it to run the test runner diff --git a/packages/test-runner/src/runAllTests.ts b/packages/test-runner/src/runAllTests.ts index 01028a404d..d25fc32b4f 100644 --- a/packages/test-runner/src/runAllTests.ts +++ b/packages/test-runner/src/runAllTests.ts @@ -1,7 +1,7 @@ -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; +import * as path from "node:path"; import glob from "fast-glob"; import Mocha from "mocha"; -import * as path from "node:path"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import { logFailedTests, shouldLogFailedTests, diff --git a/packages/test-runner/src/runners/extensionTestsNeovim.ts b/packages/test-runner/src/runners/extensionTestsNeovim.ts index d863216397..9242fc78b9 100644 --- a/packages/test-runner/src/runners/extensionTestsNeovim.ts +++ b/packages/test-runner/src/runners/extensionTestsNeovim.ts @@ -1,6 +1,5 @@ -import { TestType, runAllTests } from "../runAllTests"; - import type { NeovimClient, NvimPlugin } from "neovim"; +import { TestType, runAllTests } from "../runAllTests"; /** * Runs all extension tests. This function should only be called after attaching to the diff --git a/packages/test-runner/src/scripts/runVscodeTestsCI.ts b/packages/test-runner/src/scripts/runVscodeTestsCI.ts index c82f155da0..64fe19c5fd 100644 --- a/packages/test-runner/src/scripts/runVscodeTestsCI.ts +++ b/packages/test-runner/src/scripts/runVscodeTestsCI.ts @@ -2,8 +2,8 @@ * This file can be run from node to run vscode tests in CI */ -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import * as path from "node:path"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import { launchVscodeAndRunTests } from "../launchVscodeAndRunTests"; const extensionTestsPath = path.resolve( diff --git a/packages/test-talon-e2e/src/endToEndTestSetUp.ts b/packages/test-talon-e2e/src/endToEndTestSetUp.ts index a9037a53f4..a8169422a6 100644 --- a/packages/test-talon-e2e/src/endToEndTestSetUp.ts +++ b/packages/test-talon-e2e/src/endToEndTestSetUp.ts @@ -1,6 +1,6 @@ +import type { Context } from "mocha"; import { type IDE, SpyIDE } from "@cursorless/lib-common"; import type { TalonJsTestHelpers } from "@cursorless/lib-talonjs-core"; -import type { Context } from "mocha"; interface EndToEndTestSetupOpts { retries?: number; diff --git a/packages/test-talon-e2e/src/quickjsTest.ts b/packages/test-talon-e2e/src/quickjsTest.ts index 8d18236a15..82a4e4b4b7 100644 --- a/packages/test-talon-e2e/src/quickjsTest.ts +++ b/packages/test-talon-e2e/src/quickjsTest.ts @@ -1,10 +1,10 @@ +import * as std from "std"; import { LATEST_VERSION, type ActionDescriptor, type CommandLatest, } from "@cursorless/lib-common"; import { activate } from "@cursorless/lib-talonjs-core"; -import * as std from "std"; import { talonMock } from "./talonMock"; let hasFailed = false; diff --git a/packages/test-talon-e2e/src/recorded.talonjs.test.ts b/packages/test-talon-e2e/src/recorded.talonjs.test.ts index 4d1ce9701d..f8605cc74d 100644 --- a/packages/test-talon-e2e/src/recorded.talonjs.test.ts +++ b/packages/test-talon-e2e/src/recorded.talonjs.test.ts @@ -3,16 +3,16 @@ import { DEFAULT_TEXT_EDITOR_OPTIONS_FOR_TEST, type TextEditor, } from "@cursorless/lib-common"; -import { - activate, - type EditorState, - type TalonJsIDE, -} from "@cursorless/lib-talonjs-core"; import { getRecordedTestPaths, loadFixture, runRecordedTest, } from "@cursorless/lib-node-common"; +import { + activate, + type EditorState, + type TalonJsIDE, +} from "@cursorless/lib-talonjs-core"; import { constructTestHelpers } from "./constructTestHelpers"; import { endToEndTestSetup } from "./endToEndTestSetUp"; import { talonMock } from "./talonMock"; diff --git a/packages/test-vscode-e2e/src/endToEndTestSetup.ts b/packages/test-vscode-e2e/src/endToEndTestSetup.ts index 99515f5e7b..6f9dfa2840 100644 --- a/packages/test-vscode-e2e/src/endToEndTestSetup.ts +++ b/packages/test-vscode-e2e/src/endToEndTestSetup.ts @@ -1,11 +1,11 @@ +import type { Context } from "mocha"; +import * as sinon from "sinon"; import type { IDE, NormalizedIDE } from "@cursorless/lib-common"; import { shouldUpdateFixtures, sleep, SpyIDE } from "@cursorless/lib-common"; import { getCursorlessApi, resetReusableEditor, } from "@cursorless/lib-vscode-common"; -import type { Context } from "mocha"; -import * as sinon from "sinon"; /** * The number of times the current test has been retried. Will be 0 the first diff --git a/packages/test-vscode-e2e/src/mockPrePhraseGetVersion.ts b/packages/test-vscode-e2e/src/mockPrePhraseGetVersion.ts index 872f18a11d..331a4d6ba6 100644 --- a/packages/test-vscode-e2e/src/mockPrePhraseGetVersion.ts +++ b/packages/test-vscode-e2e/src/mockPrePhraseGetVersion.ts @@ -1,5 +1,5 @@ -import type { CommandServerApi } from "@cursorless/lib-common"; import * as sinon from "sinon"; +import type { CommandServerApi } from "@cursorless/lib-common"; export function mockPrePhraseGetVersion( commandServerApi: CommandServerApi, diff --git a/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts b/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts index ff93f468d9..58d56f453b 100644 --- a/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts @@ -1,10 +1,10 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { CURSORLESS_COMMAND_ID } from "@cursorless/lib-common"; import { getCursorlessApi, getReusableEditor, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("Backward compatibility", async function () { diff --git a/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts b/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts index 70144eb1de..c46b8c8294 100644 --- a/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts @@ -1,11 +1,11 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getCursorlessApi, openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("breakpoints", async function () { diff --git a/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts b/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts index 8ca00ff97c..0bc2b4fde0 100644 --- a/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts @@ -1,3 +1,9 @@ +import * as assert from "node:assert/strict"; +import { existsSync } from "node:fs"; +import { readFile, readdir, rm } from "node:fs/promises"; +import * as path from "node:path"; +import { produce } from "immer"; +import * as vscode from "vscode"; import type { CommandComplete, CommandHistoryEntry, @@ -9,13 +15,7 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import { existsSync } from "node:fs"; -import { readFile, readdir, rm } from "node:fs/promises"; -import * as assert from "node:assert/strict"; -import * as path from "node:path"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; -import { produce } from "immer"; /* * All tests in this file are running against the latest version of the command diff --git a/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts b/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts index 50eadcf8ac..5956f1fa41 100644 --- a/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts @@ -1,11 +1,11 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getCursorlessApi, getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; // Check that we don't run afoul of stateful regex craziness diff --git a/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts b/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts index 566c8389ea..c8e006349f 100644 --- a/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts @@ -1,3 +1,5 @@ +import * as assert from "node:assert/strict"; +import { window } from "vscode"; import { LATEST_VERSION, splitKey } from "@cursorless/lib-common"; import { getCellIndex, @@ -5,8 +7,6 @@ import { openNewNotebookEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import { window } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; // Check that setSelection is able to focus the correct cell diff --git a/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts b/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts index 1aad5ffca3..5f6ae3ccda 100644 --- a/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts @@ -1,14 +1,14 @@ +import * as assert from "node:assert/strict"; +import { window } from "vscode"; +import { LATEST_VERSION } from "@cursorless/lib-common"; import { getCellIndex, getCursorlessApi, openNewNotebookEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import { window } from "vscode"; import { endToEndTestSetup, sleepWithBackoff } from "../endToEndTestSetup"; import { getPlainNotebookContents } from "../notebook"; -import { LATEST_VERSION } from "@cursorless/lib-common"; // Check that setSelection is able to focus the correct cell suite("Edit new cell", async function () { diff --git a/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts b/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts index 151e317421..e00e5f8121 100644 --- a/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts @@ -1,11 +1,11 @@ +import * as assert from "node:assert/strict"; +import { Selection } from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getCursorlessApi, getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import { Selection } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("Explicit mark", async function () { diff --git a/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts b/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts index d5fda199db..254c610642 100644 --- a/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts @@ -1,10 +1,10 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("fold", async function () { diff --git a/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts b/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts index 46a850a561..e5c3ce4f95 100644 --- a/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts @@ -1,11 +1,11 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getFixturePath, isWindows } from "@cursorless/lib-node-common"; import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("followLink", async function () { diff --git a/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts b/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts index 9ce0fa7f59..262365330b 100644 --- a/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts @@ -1,10 +1,10 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION, splitKey } from "@cursorless/lib-common"; import { getCursorlessApi, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("Group by document", async function () { diff --git a/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts b/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts index 6ed935e692..d98024e32c 100644 --- a/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts @@ -1,3 +1,5 @@ +import * as assert from "node:assert/strict"; +import { Selection } from "vscode"; import type { Modifier, SpyIDE } from "@cursorless/lib-common"; import { HatStability, @@ -10,8 +12,6 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import { Selection } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { setupFake } from "./setupFake"; diff --git a/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts b/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts index 4424a0f1b0..12b2f20e0d 100644 --- a/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts @@ -1,15 +1,15 @@ +import * as assert from "node:assert/strict"; +import { readFile } from "node:fs/promises"; +import * as path from "node:path"; +import sinon from "sinon"; +import * as vscode from "vscode"; +import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import { getCursorlessApi, getReusableEditor, openNewEditor, } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; import { endToEndTestSetup, sleepWithBackoff } from "../../endToEndTestSetup"; -import sinon from "sinon"; -import * as path from "node:path"; -import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; -import { readFile } from "node:fs/promises"; -import * as assert from "node:assert/strict"; interface TestCase { name: string; diff --git a/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts b/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts index 2f8d8a24d7..b2243531fa 100644 --- a/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts @@ -1,3 +1,5 @@ +import assert from "node:assert/strict"; +import * as vscode from "vscode"; import type { ActionDescriptor, Modifier, @@ -5,15 +7,13 @@ import type { SimpleScopeTypeType, } from "@cursorless/lib-common"; import { asyncSafety } from "@cursorless/lib-common"; +import { isMac } from "@cursorless/lib-node-common"; import { getReusableEditor, runCursorlessAction, } from "@cursorless/lib-vscode-common"; -import assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { isCI } from "../isCI"; -import { isMac } from "@cursorless/lib-node-common"; const testData = generateTestData(100); const multiplier = calculateMultiplier(); diff --git a/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts b/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts index 333c2fd2aa..250b60f1b8 100644 --- a/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts @@ -1,10 +1,10 @@ +import * as assert from "node:assert/strict"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getCursorlessApi, openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("Pour across split", async function () { diff --git a/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts b/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts index 66387b91e6..ef8381f2d4 100644 --- a/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts @@ -1,3 +1,5 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { HatStability, LATEST_VERSION, @@ -9,8 +11,6 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { mockPrePhraseGetVersion } from "../mockPrePhraseGetVersion"; import { setupFake } from "./setupFake"; diff --git a/packages/test-vscode-e2e/src/suite/recorded.vscode.test.ts b/packages/test-vscode-e2e/src/suite/recorded.vscode.test.ts index b8692c435d..1572150ab6 100644 --- a/packages/test-vscode-e2e/src/suite/recorded.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/recorded.vscode.test.ts @@ -1,3 +1,4 @@ +import * as vscode from "vscode"; import type { TextEditor } from "@cursorless/lib-common"; import { DEFAULT_TEXT_EDITOR_OPTIONS_FOR_TEST, @@ -13,7 +14,6 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; import { endToEndTestSetup, sleepWithBackoff } from "../endToEndTestSetup"; import { setupFake } from "./setupFake"; import { shouldSkipRecordedTest } from "./shouldSkipTest"; diff --git a/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts b/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts index eaeacbbc4b..1879ad5cbe 100644 --- a/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts @@ -1,10 +1,10 @@ +import assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("revealRange", async function () { diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts index 4f8b00ae58..c2e66c5886 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts @@ -1,7 +1,7 @@ -import { type ScopeType, type ScopeTypeInfo } from "@cursorless/lib-common"; -import { isEqual } from "lodash-es"; import * as assert from "node:assert/strict"; +import { isEqual } from "lodash-es"; import type { SinonSpy } from "sinon"; +import { type ScopeType, type ScopeTypeInfo } from "@cursorless/lib-common"; import { waitFor } from "../waitFor"; export async function assertCalledWithScopeInfo( diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts index 24d38af7b7..c737ee3daf 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts @@ -1,12 +1,12 @@ +import * as sinon from "sinon"; +import type { TextDocument } from "vscode"; +import { Position, Range, commands } from "vscode"; import type { ScopeSupportInfo } from "@cursorless/lib-common"; import { ScopeSupport } from "@cursorless/lib-common"; import { getCursorlessApi, getReusableEditor, } from "@cursorless/lib-vscode-common"; -import * as sinon from "sinon"; -import type { TextDocument } from "vscode"; -import { Position, Range, commands } from "vscode"; import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo"; /** diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts index 8a8ecb751c..8e91c343c4 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts @@ -1,9 +1,9 @@ -import type { ScopeSupportInfo, ScopeType } from "@cursorless/lib-common"; -import { ScopeSupport, sleep } from "@cursorless/lib-common"; -import { getCursorlessApi, openNewEditor } from "@cursorless/lib-vscode-common"; import { stat, unlink, writeFile } from "node:fs/promises"; import * as sinon from "sinon"; import { commands } from "vscode"; +import type { ScopeSupportInfo, ScopeType } from "@cursorless/lib-common"; +import { ScopeSupport, sleep } from "@cursorless/lib-common"; +import { getCursorlessApi, openNewEditor } from "@cursorless/lib-vscode-common"; import { assertCalledWithScopeInfo, assertCalledWithoutScopeInfo, diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts index 4bb9b5222f..193b9d0b57 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts @@ -1,8 +1,8 @@ +import { stat, unlink, writeFile } from "node:fs/promises"; +import * as sinon from "sinon"; import type { ScopeTypeInfo } from "@cursorless/lib-common"; import { DOCS_URL, sleep } from "@cursorless/lib-common"; import { getCursorlessApi } from "@cursorless/lib-vscode-common"; -import { stat, unlink, writeFile } from "node:fs/promises"; -import * as sinon from "sinon"; import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo"; /** diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts index 6312ae1c73..80549e7772 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/runSurroundingPairScopeInfoTest.ts @@ -1,8 +1,8 @@ +import * as sinon from "sinon"; +import { Position, commands } from "vscode"; import type { ScopeSupportInfo } from "@cursorless/lib-common"; import { ScopeSupport } from "@cursorless/lib-common"; import { getCursorlessApi, openNewEditor } from "@cursorless/lib-vscode-common"; -import * as sinon from "sinon"; -import { Position, commands } from "vscode"; import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo"; /** diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts index 24cecf4cc4..a4f5feff9a 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts @@ -1,10 +1,10 @@ import * as assert from "node:assert/strict"; import type * as sinon from "sinon"; +import type { Fakes, ExpectedArgs } from "./scopeVisualizerTest.types"; import { createDecorationTypeCallToPlainObject, setDecorationsCallToPlainObject, } from "./spyCallsToPlainObject"; -import type { Fakes, ExpectedArgs } from "./scopeVisualizerTest.types"; export function checkAndResetFakes(fakes: Fakes, expected: ExpectedArgs) { const actual = getSpyCallsAndResetFakes(fakes); diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts index a8f686e8d5..9f20a23ebc 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/injectFakes.ts @@ -1,7 +1,7 @@ -import type { VscodeApi } from "@cursorless/lib-vscode-common"; -import { getCursorlessApi } from "@cursorless/lib-vscode-common"; import * as sinon from "sinon"; import type { DecorationRenderOptions, WorkspaceConfiguration } from "vscode"; +import type { VscodeApi } from "@cursorless/lib-vscode-common"; +import { getCursorlessApi } from "@cursorless/lib-vscode-common"; import { COLOR_CONFIG } from "./colorConfig"; import type { Fakes, diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts index f03743ae13..133473384c 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicMultilineContentTest.ts @@ -1,5 +1,5 @@ -import { openNewEditor } from "@cursorless/lib-vscode-common"; import * as vscode from "vscode"; +import { openNewEditor } from "@cursorless/lib-vscode-common"; import { checkAndResetFakes } from "./checkAndResetFakes"; import { injectFakes } from "./injectFakes"; import type { ExpectedArgs } from "./scopeVisualizerTest.types"; diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts index 4d75b9f37e..95c195a12b 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runBasicRemovalTest.ts @@ -1,5 +1,5 @@ -import { openNewEditor } from "@cursorless/lib-vscode-common"; import * as vscode from "vscode"; +import { openNewEditor } from "@cursorless/lib-vscode-common"; import { checkAndResetFakes } from "./checkAndResetFakes"; import { injectFakes } from "./injectFakes"; import type { ExpectedArgs } from "./scopeVisualizerTest.types"; diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts index dbfd3aab2d..bb6fb4db22 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runNestedMultilineContentTest.ts @@ -1,7 +1,7 @@ -import { openNewEditor } from "@cursorless/lib-vscode-common"; import * as vscode from "vscode"; -import { injectFakes } from "./injectFakes"; +import { openNewEditor } from "@cursorless/lib-vscode-common"; import { checkAndResetFakes } from "./checkAndResetFakes"; +import { injectFakes } from "./injectFakes"; import type { ExpectedArgs } from "./scopeVisualizerTest.types"; /** diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts index 9770a82370..9a61e5d468 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/runUpdateTest.ts @@ -1,8 +1,8 @@ -import { getReusableEditor } from "@cursorless/lib-vscode-common"; import * as vscode from "vscode"; +import { getReusableEditor } from "@cursorless/lib-vscode-common"; import { sleepWithBackoff } from "../../endToEndTestSetup"; -import { injectFakes } from "./injectFakes"; import { checkAndResetFakes } from "./checkAndResetFakes"; +import { injectFakes } from "./injectFakes"; import type { ExpectedArgs } from "./scopeVisualizerTest.types"; /** diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizer.vscode.test.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizer.vscode.test.ts index 603b8cd82f..69499b98e6 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizer.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizer.vscode.test.ts @@ -1,6 +1,6 @@ +import { commands } from "vscode"; import { asyncSafety } from "@cursorless/lib-common"; import { getCursorlessApi } from "@cursorless/lib-vscode-common"; -import { commands } from "vscode"; import { endToEndTestSetup } from "../../endToEndTestSetup"; import { runBasicMultilineContentTest } from "./runBasicMultilineContentTest"; import { runBasicRemovalTest } from "./runBasicRemovalTest"; diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts index 55bfc9693f..68b342b6d4 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/scopeVisualizerTest.types.ts @@ -1,7 +1,7 @@ -import type { RangePlainObject } from "@cursorless/lib-common"; -import type { VscodeApi } from "@cursorless/lib-vscode-common"; import type * as sinon from "sinon"; import type * as vscode from "vscode"; +import type { RangePlainObject } from "@cursorless/lib-common"; +import type { VscodeApi } from "@cursorless/lib-vscode-common"; export interface MockDecorationType { dispose(): void; diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts index 2cb5479cfe..57dc540442 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/spyCallsToPlainObject.ts @@ -1,12 +1,12 @@ -import { rangeToPlainObject } from "@cursorless/lib-common"; +import type { SinonSpyCall } from "sinon"; import type { DecorationRenderOptions } from "vscode"; +import { rangeToPlainObject } from "@cursorless/lib-common"; import type { SetDecorationsParameters, DecorationRangesPlainObject, DecorationRenderOptionsPlainObject, MockDecorationType, } from "./scopeVisualizerTest.types"; -import type { SinonSpyCall } from "sinon"; export function setDecorationsCallToPlainObject({ args: [_editor, decorationType, ranges], diff --git a/packages/test-vscode-e2e/src/suite/scroll.vscode.test.ts b/packages/test-vscode-e2e/src/suite/scroll.vscode.test.ts index e2196a1466..870bb6b2a4 100644 --- a/packages/test-vscode-e2e/src/suite/scroll.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/scroll.vscode.test.ts @@ -1,9 +1,9 @@ +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("scroll", async function () { diff --git a/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts b/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts index 81f3b2e5c0..124b79cb10 100644 --- a/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts @@ -1,3 +1,9 @@ +import * as assert from "node:assert/strict"; +import * as crypto from "node:crypto"; +import { mkdir, readFile, readdir, rm } from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import * as vscode from "vscode"; import type { HatTokenMap, SimpleActionName } from "@cursorless/lib-common"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { @@ -9,12 +15,6 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as crypto from "node:crypto"; -import { mkdir, readFile, readdir, rm } from "node:fs/promises"; -import * as assert from "node:assert/strict"; -import * as os from "node:os"; -import * as path from "node:path"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; /* diff --git a/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts b/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts index 08abbccb41..801caa0000 100644 --- a/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts @@ -1,9 +1,9 @@ +import assert from "node:assert/strict"; +import * as vscode from "vscode"; import { getCursorlessApi, getReusableEditor, } from "@cursorless/lib-vscode-common"; -import assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("toggle decorations", async function () { diff --git a/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts b/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts index 0199d32440..7d3d141c90 100644 --- a/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts @@ -1,3 +1,8 @@ +import assert from "node:assert/strict"; +import path from "node:path"; +import { isEqual } from "lodash-es"; +import sinon from "sinon"; +import { commands } from "vscode"; import type { SpyIDE, TestCaseFixtureLegacy } from "@cursorless/lib-common"; import { LATEST_VERSION, @@ -13,11 +18,6 @@ import { runCursorlessCommand, type SpyWebViewEvent, } from "@cursorless/lib-vscode-common"; -import { isEqual } from "lodash-es"; -import assert from "node:assert/strict"; -import path from "node:path"; -import sinon from "sinon"; -import { commands } from "vscode"; import { endToEndTestSetup } from "../../endToEndTestSetup"; import { waitFor } from "../waitFor"; diff --git a/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts b/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts index a444c4305a..af7ee4260a 100644 --- a/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts @@ -1,10 +1,10 @@ +import * as assert from "node:assert/strict"; +import * as vscode from "vscode"; import { LATEST_VERSION } from "@cursorless/lib-common"; import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("visible", async function () { diff --git a/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts b/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts index 331276e075..4d3775648c 100644 --- a/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts @@ -1,3 +1,5 @@ +import * as assert from "node:assert/strict"; +import { window } from "vscode"; import { LATEST_VERSION, splitKey } from "@cursorless/lib-common"; import { getCellIndex, @@ -5,8 +7,6 @@ import { openNewNotebookEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; -import { window } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; // Check that setSelection is able to focus the correct cell diff --git a/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts b/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts index 5114d311ee..0a7a1c2609 100644 --- a/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts @@ -1,10 +1,10 @@ +import * as assert from "node:assert/strict"; import { HatStability, LATEST_VERSION } from "@cursorless/lib-common"; import { getCursorlessApi, openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert/strict"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { setupFake } from "./setupFake"; diff --git a/packages/tool-meta-updater/src/getCursorlessVscodeFields.ts b/packages/tool-meta-updater/src/getCursorlessVscodeFields.ts index fbf673cc17..c7cf2fbee8 100644 --- a/packages/tool-meta-updater/src/getCursorlessVscodeFields.ts +++ b/packages/tool-meta-updater/src/getCursorlessVscodeFields.ts @@ -1,5 +1,5 @@ -import { cursorlessCommandDescriptions } from "@cursorless/lib-common"; import type { PackageJson } from "type-fest"; +import { cursorlessCommandDescriptions } from "@cursorless/lib-common"; export function getCursorlessVscodeFields(input: PackageJson) { return { diff --git a/packages/tool-meta-updater/src/metaUpdater.ts b/packages/tool-meta-updater/src/metaUpdater.ts index 664aec271d..f4c1fad4ce 100644 --- a/packages/tool-meta-updater/src/metaUpdater.ts +++ b/packages/tool-meta-updater/src/metaUpdater.ts @@ -2,9 +2,9 @@ // https://github.com/pnpm/pnpm/tree/d583fbb2ad7e6b986d133a4eaf60824713f13c06/.meta-updater/src/index.ts // License was // https://github.com/pnpm/pnpm/blob/d583fbb2ad7e6b986d133a4eaf60824713f13c06/LICENSE -import { languageScopeSupport } from "@cursorless/lib-common"; import { readWantedLockfile } from "@pnpm/lockfile-file"; import { createUpdateOptions } from "@pnpm/meta-updater"; +import { languageScopeSupport } from "@cursorless/lib-common"; import type { Context } from "./Context"; import { textFormat } from "./textFormat"; import { updateLanguageMdx } from "./updateLanguageMdx"; diff --git a/packages/tool-meta-updater/src/textFormat.ts b/packages/tool-meta-updater/src/textFormat.ts index ee067c6209..4db0c748fb 100644 --- a/packages/tool-meta-updater/src/textFormat.ts +++ b/packages/tool-meta-updater/src/textFormat.ts @@ -1,5 +1,5 @@ -import { createFormat } from "@pnpm/meta-updater"; import * as fs from "node:fs/promises"; +import { createFormat } from "@pnpm/meta-updater"; export const textFormat = createFormat({ read: ({ resolvedPath }) => fs.readFile(resolvedPath, "utf8"), diff --git a/packages/tool-meta-updater/src/updateLanguageMdx.ts b/packages/tool-meta-updater/src/updateLanguageMdx.ts index 5e396348ec..cf1514b6cf 100644 --- a/packages/tool-meta-updater/src/updateLanguageMdx.ts +++ b/packages/tool-meta-updater/src/updateLanguageMdx.ts @@ -1,5 +1,5 @@ -import { prettifyLanguageName } from "@cursorless/lib-common"; import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; +import { prettifyLanguageName } from "@cursorless/lib-common"; export function updateLanguageMdx( languageId: string, diff --git a/packages/tool-meta-updater/src/updatePackageJson.ts b/packages/tool-meta-updater/src/updatePackageJson.ts index e1e04a2cfc..37da450ca5 100644 --- a/packages/tool-meta-updater/src/updatePackageJson.ts +++ b/packages/tool-meta-updater/src/updatePackageJson.ts @@ -1,7 +1,7 @@ -import { omitByDeep } from "@cursorless/lib-common"; import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import { isUndefined } from "lodash-es"; import type { PackageJson } from "type-fest"; +import { omitByDeep } from "@cursorless/lib-common"; import type { Context } from "./Context"; import { getCursorlessVscodeFields } from "./getCursorlessVscodeFields"; diff --git a/packages/tool-meta-updater/src/updateScopeMdx.ts b/packages/tool-meta-updater/src/updateScopeMdx.ts index 63a4da2b62..b41a3ad7b0 100644 --- a/packages/tool-meta-updater/src/updateScopeMdx.ts +++ b/packages/tool-meta-updater/src/updateScopeMdx.ts @@ -1,3 +1,4 @@ +import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import type { ScopeTypeType } from "@cursorless/lib-common"; import { plaintextScopeSupportFacetInfos, @@ -5,7 +6,6 @@ import { scopeSupportFacetInfos, serializeScopeType, } from "@cursorless/lib-common"; -import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; export function updateScopeMdx( scopeTypeType: ScopeTypeType, diff --git a/packages/tool-meta-updater/src/updateTSConfig.ts b/packages/tool-meta-updater/src/updateTSConfig.ts index 2731d6d850..bbd2cc6c4d 100644 --- a/packages/tool-meta-updater/src/updateTSConfig.ts +++ b/packages/tool-meta-updater/src/updateTSConfig.ts @@ -1,8 +1,8 @@ +import * as path from "node:path"; import { getLockfileImporterId } from "@pnpm/lockfile-file"; import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import { cloneDeep, isEqual } from "lodash-es"; import normalizePath from "normalize-path"; -import * as path from "node:path"; import type { TsConfigJson } from "type-fest"; import type { Context } from "./Context"; import { toPosixPath } from "./toPosixPath"; diff --git a/packages/tool-meta-updater/src/updateTSConfigBase.ts b/packages/tool-meta-updater/src/updateTSConfigBase.ts index 97c73a12ea..d722ed6f3c 100644 --- a/packages/tool-meta-updater/src/updateTSConfigBase.ts +++ b/packages/tool-meta-updater/src/updateTSConfigBase.ts @@ -1,5 +1,5 @@ -import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import * as fs from "node:fs/promises"; +import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import type { PackageJson, TsConfigJson } from "type-fest"; import type { Context } from "./Context"; diff --git a/packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts b/packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts index ed75c9177f..6b6d64bcbe 100644 --- a/packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts +++ b/packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts @@ -1,3 +1,4 @@ +import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import type { ScopeSupportFacet, PlaintextScopeSupportFacet, @@ -7,7 +8,6 @@ import { serializeScopeType, plaintextScopeSupportFacetInfos, } from "@cursorless/lib-common"; -import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; export function updatesScopeSupportFacetInfos( actual: string | null,