Skip to content

New syntax for cursorless overrides #554

Open
@pokey

Description

@pokey

The problem

Our current override csvs are missing a couple pieces of functionality:

  • Context-specific definitions / overrides, eg only active when in Python file
  • Extra information on members, such as we would want for Add arguments to cursorless_vscode_command #453, and potentially for snippets, though for snippets we might want the information VSCode-side

The solution

We'd like to switch to a syntax like the following:

language: python
-
hello world: bar
whatever: false {}
whatever:
    false
    {}
export {}
import
empty map: {}
empty quotes: ""
-: setSelection

Notice the following:

  • Spoken form, then colon, then value
  • Can have a json object at the end
  • These are actually defining captures, not lists, because lists can't have any info other than a string. There will also be a list, but it won't have the extra info
  • If no colon, spoken form equals value
  • above the - is just a talon context
  • the filename will be foo.bar.capture, where foo will be the name of the list and the capture. Might tweak the extension (.list? .cursorless-list?)
  • can break into multiple lines, as long as they're indented
  • starting spoken form with a - removes it

Alternatives considered

yaml

scope:
    language: python
list:
    hello world: bar

toml

[scope]
language = "python"

[list.my_list]
hello world = "bar"

toml with talon context header

language: python
-
[my_list]
hello world = "bar"

[my_list.whatever now]
value = 

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