Skip to content

keyboard: support ordinal modifiers #2414

Open
@pokey

Description

@pokey

Some links:

  • Search the code base for nextPrev. You'll need to make a new type of token called ordinal that functions identically to nextPrev, but creates an ordinalScope modifier instead of the relativeScope created by nextPrev
  • Here is the shape of the ordinal modifier you'll end up creating from our keyboard grammar:
    /**
    * Refer to scopes by absolute index relative to iteration scope, eg "first
    * funk" to refer to the first function in a class.
    */
    export interface OrdinalScopeModifier {
    type: "ordinalScope";
    scopeType: ScopeType;
    /** The start of the range. Start from end of iteration scope if `start` is negative */
    start: number;
    /** The number of scopes to include. Will always be positive. If greater than 1, will include scopes after {@link start} */
    length: number;
    /** If true, yields individual targets instead of contiguous range. Defaults to `false` */
    isEvery?: boolean;
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions