Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eslint.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const rootConfig: ConfigWithExtends = {

rules: {
"import/no-relative-packages": "error",
"import/no-duplicates": "error",
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
Expand All @@ -75,7 +77,6 @@ const rootConfig: ConfigWithExtends = {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.31.0",
"@eslint/js": "^9.32.0",
"@pnpm/meta-updater": "^2.0.6",
"@types/node": "^24.1.0",
"esbuild": "^0.25.8",
"eslint": "^9.31.0",
"eslint": "^9.32.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { SimpleScopeTypeType } from "../types/command/PartialTargetDescriptor.types";
import { type ScopeType } from "../types/command/PartialTargetDescriptor.types";
import type {
ScopeType,
SimpleScopeTypeType,
} from "../types/command/PartialTargetDescriptor.types";

export const scopeSupportFacets = [
"command",
Expand Down
2 changes: 1 addition & 1 deletion packages/cursorless-engine/src/CommandHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type {
ActionDescriptor,
CommandComplete,
CommandHistoryEntry,
CommandHistoryStorage,
CommandServerApi,
IDE,
ReadOnlyHatMap,
} from "@cursorless/common";
import { type CommandHistoryStorage } from "@cursorless/common";
import { produce } from "immer";
import { v4 as uuid } from "uuid";
import type { CommandRunner } from "./CommandRunner";
Expand Down
3 changes: 2 additions & 1 deletion packages/cursorless-engine/src/CommandHistoryAnalyzer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type {
CommandHistoryEntry,
CommandHistoryStorage,
Modifier,
PartialPrimitiveTargetDescriptor,
ScopeType,
} from "@cursorless/common";
import { showWarning, type CommandHistoryStorage } from "@cursorless/common";
import { showWarning } from "@cursorless/common";
import { groupBy, map, sum } from "lodash-es";
import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand";
import { ide } from "./singletons/ide.singleton";
Expand Down
5 changes: 2 additions & 3 deletions packages/cursorless-engine/src/core/StoredTargets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { DefaultMap, Notifier } from "@cursorless/common";
import type { Target } from "../typings/target.types";
import type { StoredTargetKey } from "@cursorless/common";
import { storedTargetKeys } from "@cursorless/common";
import { DefaultMap, Notifier, storedTargetKeys } from "@cursorless/common";
import type { Target } from "../typings/target.types";
import { UndoStack } from "./UndoStack";

const MAX_HISTORY_LENGTH = 25;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import type { ActionType, ActionTypeV2 } from "@cursorless/common";
import type { CommandV2 } from "@cursorless/common";
import type {
ActionType,
ActionTypeV2,
CommandV1,
CommandV2,
ModifierV0V1,
ModifierV2,
PartialPrimitiveTargetDescriptorV2,
PartialPrimitiveTargetV0V1,
PartialRangeTargetDescriptorV2,
PartialTargetDescriptorV2,
SimpleScopeTypeTypeV2,
} from "@cursorless/common";
import type {
CommandV1,
ModifierV0V1,
PartialPrimitiveTargetV0V1,
PartialTargetV0V1,
SimpleScopeTypeTypeV2,
} from "@cursorless/common";
import { upgradeStrictHere } from "./upgradeStrictHere";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type {
CommandV6,
DestinationDescriptor,
EnforceUndefined,
ExecuteCommandOptions,
GetTextActionOptions,
HighlightActionDescriptor,
HighlightId,
ImplicitDestinationDescriptor,
Expand All @@ -27,10 +29,6 @@ import type {
ReplaceWith,
WrapWithSnippetArg,
} from "@cursorless/common";
import {
type ExecuteCommandOptions,
type GetTextActionOptions,
} from "@cursorless/common";
import canonicalizeActionName from "./canonicalizeActionName";

export function upgradeV5ToV6(command: CommandV5): EnforceUndefined<CommandV6> {
Expand Down
10 changes: 4 additions & 6 deletions packages/cursorless-engine/src/cursorlessEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import type {
CommandServerApi,
Hats,
IDE,
RawTreeSitterQueryProvider,
ScopeProvider,
TalonSpokenForms,
TreeSitter,
} from "@cursorless/common";
import {
ensureCommandShape,
type RawTreeSitterQueryProvider,
type TalonSpokenForms,
type TreeSitter,
} from "@cursorless/common";
import { ensureCommandShape } from "@cursorless/common";
import { KeyboardTargetUpdater } from "./KeyboardTargetUpdater";
import type {
CommandRunnerDecorator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import type {
BringMoveActionDescriptor,
ContainingScopeModifier,
DestinationDescriptor,
Direction,
InsertionMode,
Modifier,
PartialListTargetDescriptor,
PartialMark,
PartialPrimitiveTargetDescriptor,
PartialRangeTargetDescriptor,
PartialTargetDescriptor,
PartialTargetMark,
PrimitiveDestinationDescriptor,
RelativeScopeModifier,
} from "@cursorless/common";
import {
type ContainingScopeModifier,
type Modifier,
type PartialMark,
type PartialPrimitiveTargetDescriptor,
type PartialTargetDescriptor,
type ScopeType,
type SimpleActionDescriptor,
type SimpleActionName,
type SimplePartialMark,
type SimpleScopeType,
type SimpleScopeTypeType,
type SurroundingPairName,
type SurroundingPairScopeType,
ScopeType,
SimpleActionDescriptor,
SimpleActionName,
SimplePartialMark,
SimpleScopeType,
SimpleScopeTypeType,
SurroundingPairName,
SurroundingPairScopeType,
} from "@cursorless/common";
import type { WithPlaceholders } from "./WithPlaceholders";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ScopeType } from "@cursorless/common";
import { type ActionDescriptor } from "@cursorless/common";
import type { ActionDescriptor, ScopeType } from "@cursorless/common";
import { Grammar, Parser } from "nearley";
import type { WithPlaceholders } from "./WithPlaceholders";
import grammar from "./generated/grammar";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import type {
Disposable,
Listener,
ScopeType,
TalonSpokenForms,
} from "@cursorless/common";
import { SpokenFormGenerator } from "./generateSpokenForm";
import type { CustomSpokenFormGenerator } from "../api/CursorlessEngineApi";
import { CustomSpokenForms } from "../spokenForms/CustomSpokenForms";
import type { TalonSpokenForms } from "@cursorless/common";
import { SpokenFormGenerator } from "./generateSpokenForm";

/**
* Simple facade that combines the {@link CustomSpokenForms} and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import type {
IDE,
RawTreeSitterQueryProvider,
ScopeType,
SimpleScopeType,
SimpleScopeTypeType,
TextDocument,
TreeSitter,
} from "@cursorless/common";
import {
matchAll,
showError,
type IDE,
type TextDocument,
} from "@cursorless/common";
import { matchAll, showError } from "@cursorless/common";
import { TreeSitterScopeHandler } from "../processTargets/modifiers/scopeHandlers";
import { TreeSitterQuery } from "./TreeSitterQuery";
import type { QueryCapture } from "./TreeSitterQuery/QueryCapture";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Disposable } from "@cursorless/common";
import {
Notifier,
showError,
type IDE,
type Listener,
type RawTreeSitterQueryProvider,
type TreeSitter,
import type {
Disposable,
IDE,
Listener,
RawTreeSitterQueryProvider,
TreeSitter,
} from "@cursorless/common";
import { Notifier, showError } from "@cursorless/common";
import { toString } from "lodash-es";
import { LanguageDefinition } from "./LanguageDefinition";
import { treeSitterQueryCache } from "./TreeSitterQuery/treeSitterQueryCache";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import type { Position, TextDocument } from "@cursorless/common";
import { type TreeSitter } from "@cursorless/common";
import type { Position, TextDocument, TreeSitter } from "@cursorless/common";
import type * as treeSitter from "web-tree-sitter";
import { ide } from "../../singletons/ide.singleton";
import { checkCaptureStartEnd } from "./checkCaptureStartEnd";
import { getNodeRange } from "./getNodeRange";
import { isContainedInErrorNode } from "./isContainedInErrorNode";
import { normalizeCaptureName } from "./normalizeCaptureName";
import { parsePredicatesWithErrorHandling } from "./parsePredicatesWithErrorHandling";
import { positionToPoint } from "./positionToPoint";
import type {
MutableQueryCapture,
MutableQueryMatch,
QueryMatch,
} from "./QueryCapture";
import { checkCaptureStartEnd } from "./checkCaptureStartEnd";
import { isContainedInErrorNode } from "./isContainedInErrorNode";
import { normalizeCaptureName } from "./normalizeCaptureName";
import { parsePredicatesWithErrorHandling } from "./parsePredicatesWithErrorHandling";
import { positionToPoint } from "./positionToPoint";
import {
getStartOfEndOfRange,
rewriteStartOfEndOf,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { LineNumberMark, LineNumberType } from "@cursorless/common";
import type { TextEditor } from "@cursorless/common";
import type {
LineNumberMark,
LineNumberType,
TextEditor,
} from "@cursorless/common";
import { ide } from "../../singletons/ide.singleton";
import type { MarkStage } from "../PipelineStages.types";
import { createLineTarget } from "../modifiers/scopeHandlers";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import type { TextEditor, Position } from "@cursorless/common";
import type { Direction, ScopeType } from "@cursorless/common";
import type {
Direction,
Position,
ScopeType,
TextEditor,
} from "@cursorless/common";
import { DocumentTarget } from "../../targets";
import { BaseScopeHandler } from "./BaseScopeHandler";
import type { TargetScope } from "./scope.types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import type { Direction, ScopeType } from "@cursorless/common";
import type { Position, TextEditor } from "@cursorless/common";
import type {
Direction,
Position,
ScopeType,
TextEditor,
} from "@cursorless/common";
import { flatmap } from "itertools";
import { BaseScopeHandler } from "./BaseScopeHandler";
import type { ScopeHandlerFactory } from "./ScopeHandlerFactory";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type {
Direction,
Position,
Range,
ScopeType,
TextDocument,
TextEditor,
TextLine,
} from "@cursorless/common";
import type { Direction, ScopeType } from "@cursorless/common";
import { ParagraphTarget } from "../../targets";
import { BaseScopeHandler } from "./BaseScopeHandler";
import { fitRangeToLineContent } from "./LineScopeHandler";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import {
NoContainingScopeError,
Range,
type Direction,
type InteriorScopeType,
type Position,
type ScopeType,
type TextEditor,
import type {
Direction,
InteriorScopeType,
Position,
ScopeType,
TextEditor,
} from "@cursorless/common";
import { NoContainingScopeError, Range } from "@cursorless/common";
import type { LanguageDefinitions } from "../../../../languages/LanguageDefinitions";
import type { Target } from "../../../../typings/target.types";
import { InteriorTarget } from "../../../targets";
import { BaseScopeHandler } from "../BaseScopeHandler";
import { FallbackScopeHandler } from "../FallbackScopeHandler";
import { SortedScopeHandler } from "../SortedScopeHandler";
import type { TargetScope } from "../scope.types";
import type {
ComplexScopeType,
ScopeHandler,
ScopeIteratorRequirements,
} from "../scopeHandler.types";
import { type ScopeHandler } from "../scopeHandler.types";
import type { ScopeHandlerFactory } from "../ScopeHandlerFactory";
import { SortedScopeHandler } from "../SortedScopeHandler";

export class InteriorScopeHandler extends BaseScopeHandler {
protected isHierarchical = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import type { Direction, Position, TextEditor } from "@cursorless/common";
import { type SurroundingPairInteriorScopeType } from "@cursorless/common";
import type {
Direction,
Position,
SurroundingPairInteriorScopeType,
TextEditor,
} from "@cursorless/common";
import { BaseScopeHandler } from "../BaseScopeHandler";
import type { TargetScope } from "../scope.types";
import type { ScopeIteratorRequirements } from "../scopeHandler.types";
import { type ScopeHandler } from "../scopeHandler.types";
import type {
ScopeHandler,
ScopeIteratorRequirements,
} from "../scopeHandler.types";
import type { ScopeHandlerFactory } from "../ScopeHandlerFactory";

export class SurroundingPairInteriorScopeHandler extends BaseScopeHandler {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { SimpleSurroundingPairName } from "@cursorless/common";
import {
isString,
type ComplexSurroundingPairName,
type SurroundingPairName,
import type {
ComplexSurroundingPairName,
SimpleSurroundingPairName,
SurroundingPairName,
} from "@cursorless/common";
import { isString } from "@cursorless/common";
import { concat, uniq } from "lodash-es";
import { complexDelimiterMap, getSimpleDelimiterMap } from "./delimiterMaps";
import type { IndividualDelimiter } from "./types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { SimpleSurroundingPairName } from "@cursorless/common";
import { type Range } from "@cursorless/common";
import type { Range, SimpleSurroundingPairName } from "@cursorless/common";

/**
* Used to indicate whether a particular side of the delimiter is left or right
Expand Down
Loading
Loading