Skip to main content

Module context

Module context 

Source
Expand description

What kind of code the cursor is in, worked out from the tokens before it. Code being typed rarely parses, so this reads tokens rather than the syntax tree: it only needs to know which blocks, calls and brackets are open and what came last.

StructsΒ§

Call πŸ”’
The call whose argument list the cursor is directly in.
Context πŸ”’
The cursor’s context, and the call being written around it, if any.
Scanner πŸ”’

EnumsΒ§

BlockKind πŸ”’
What a { … } holds, which decides the statements allowed in it.
Frame πŸ”’
Slot πŸ”’
Where the cursor is, and so what may be typed there.

ConstantsΒ§

LOOK_BACK πŸ”’
How many recent tokens the scanner keeps: enough for for index, item.

FunctionsΒ§

at πŸ”’
call_slot πŸ”’
declares_name πŸ”’
ends_value πŸ”’
expression_slot πŸ”’
After an operator or opening bracket an expression may start; after a value, a name being declared or a member ., nothing from the completion list fits.
trailing_block πŸ”’
What the block after a call to callee holds.