Expand description
Formula autocomplete, window-free: the word being typed before the caret, what may complete it (functions, measures, categories), the ghost text painted after the caret, and the edit that accepting a candidate makes. The formula editors draw the list, the ghost and the signature tooltip from these.
Structs§
- Candidate
- One completion: the name shown, and what accepting it inserts.
- Popup
- One editor’s popup: the selected candidate, and whether Esc closed it (it stays closed until the text changes).
Enums§
- Kind
- What a candidate names.
Constants§
- MAX_
ITEMS - At most this many candidates are listed.
Functions§
- accept
- Replace the word at
caret(through the end of the identifier the caret is in) withcand: the new text and the caret after it. A function lands asNAME(with the caret after the(, reusing a(that already follows. - call_
hint 🔒 NAME(params)under the name the user typed (an alias keeps its own).- candidates
- What may complete
word, case-insensitively: the model’s measures, then its categories (each sorted), then the functions, shortest first. A'quotedword completes model names only. - clamp_
variadic 🔒 - Argument
iofdefas an index into itsnames: a variadic tail repeats, so an index past it lands on the…(or the last name). - ghost
- The ghost text after the caret, which must end
text. While completing (candis the selected candidate for the word there) it is the rest of that name, and a function’s(params); else, inside a call, the parameters from the current argument on: afterPMT(0.05,it isnper, pv, [fv], [type]), afterPMT(0.05it is, nper, …). - hint_
parts def’s hint split around argumentarg: (before, current, after), so the current parameter can be drawn bold. Noarg(or one past a fixed parameter list) leavescurrentempty.- ident_
char 🔒 - in_
string 🔒 - Whether byte
ioftextis inside a"string". - offer
- The list to offer while typing at
caret:candidatesfor the word there, at mostMAX_ITEMS. Empty once the word is exactly a measure or category name, so Enter afterPrice * Quantitycommits, and when the caret is inside a word or right before a((the call is written). - prefix
- The word being typed before
caret, if it can be completed: not empty, starting with a letter,_or', and not in a string. - short_
doc d’s description without aNAME(…)call that spells its parameters (payment per period: PMT(rate, nper, …)), which a hint already shows.- word_
start - Byte offset where the word ending at
caretstarts: the identifier run before it, or an open'quoted name(spaces and all).