Sheet kit command

editor.formula

Type in the Formula Bar

Types in the formula bar: the text becomes the active cell's typing (started from what the cell holds), so the cell shows it and pointing at cells inserts their references at the caret. With enter, enters it as Enter (down), Shift+Enter (up), Tab (right), Shift+Tab (left) or the check button (stay) do. With peek, changes nothing. With no params, drops the typing as Escape does. Answers the typing, its selection, its references and the function list and argument hint at the caret. Offsets are UTF-16.

Kit
Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
Changes the document
no

Parameters

Parameters of editor.formula
NameTypeRequiredDescription
endnumbernoEnd of the selection (UTF-16 offset); default the end of the text
enter"down" | "up" | "right" | "left" | "stay"noEnters the typing and moves the active cell
peekbooleannotrue answers the typing without changing anything
startnumbernoStart of the selection (UTF-16 offset); default the end of the text
textstringnoThe formula bar's text

Call through sheet_run

text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "editor.formula" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: end, enter, peek, start, text. sheet_run answers the step’s result in completed[i].result.

Result

Result of editor.formula
NameTypeRequiredDescription
editingbooleanno
endnumberno
hintnull | objectno
pointingbooleanno
referencesobject[]no
startnumberno
textnull | stringno
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "editing": {
      "type": "boolean"
    },
    "end": {
      "type": "number"
    },
    "hint": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "pointing": {
      "type": "boolean"
    },
    "references": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "color": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "end": {
            "type": "number"
          },
          "start": {
            "type": "number"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "start": {
      "type": "number"
    },
    "text": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "end": {
      "description": "End of the selection (UTF-16 offset); default the end of the text",
      "type": "number"
    },
    "enter": {
      "description": "Enters the typing and moves the active cell",
      "enum": [
        "down",
        "up",
        "right",
        "left",
        "stay"
      ],
      "type": "string"
    },
    "peek": {
      "description": "true answers the typing without changing anything",
      "type": "boolean"
    },
    "start": {
      "description": "Start of the selection (UTF-16 offset); default the end of the text",
      "type": "number"
    },
    "text": {
      "description": "The formula bar's text",
      "type": "string"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (sheet_commands through @kition/[email protected], built from KitionAI/kition-sheet@82f13b2). As data: commands.jsonl.