Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC of cursorless non-text API #423

Open
pokey opened this issue Jan 4, 2022 · 0 comments
Open

POC of cursorless non-text API #423

pokey opened this issue Jan 4, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@pokey
Copy link
Member

pokey commented Jan 4, 2022

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

@pokey pokey added the enhancement New feature or request label Jan 5, 2022
@AndreasArvidsson AndreasArvidsson removed their assignment Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants