Skip to content

POC of cursorless non-text API #423

@pokey

Description

@pokey

Why?

We want to apply cursorless grammar / decorations to non-textual entities such as a file browser, email client, cursorless cheatsheet interface, etc

How?

We'll do a POC of a cursorless file browser. We proceed in the following milestones:

Milestone 1

  1. Build a third-party extension that renders a file tree for a particular directory in a webview
  2. The extension calls a cursorless api function, passing a list of tokens to be decorated
  3. Cursorless does the following:
    1. adds these tokens to its list of all editor tokens, adding some field pointing back to the token given by third-party
    2. returns a list of decoration info back to third-party including svgs and character offsets so that extension can do rendering
  4. Extension renders the hats in the appropriate place in its webview

Milestone 2

  1. When cursorless receives a command from talon, it can detect that the mark was from third party and call function on third-party to get the target. It should probably leverage new pipelines at this point, so we'll want to hold off on this impl for now

Milestone 3

  1. When cursorless processes a scope type that is third-party, it will call a function on third-party to process modifier

Questions

  • How do we handle focus? The webview may or may not be focused
  • Somehow, extension should be able to register new scope types both extension and talon-side. Probably want state sharing (like Expose shape enablement #287) for this one

Philosophical points / future directions

We view text files as a special case, and can refactor our language / text support to rely on the same general purpose API

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions