CompletionContext

class CompletionContext(val state: EditorState, val pos: DocPos, val explicit: Boolean)

Context passed to completion sources.

Parameters

state

The current editor state.

pos

The cursor position where completion was triggered.

explicit

Whether completion was explicitly requested (e.g. Ctrl-Space).

Constructors

Link copied to clipboard
constructor(state: EditorState, pos: DocPos, explicit: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard
val pos: DocPos
Link copied to clipboard

Functions

Link copied to clipboard

Match pattern against the text directly before the cursor on the current line (at most 250 characters back), returning the leftmost match that ends at the cursor, or null.

Link copied to clipboard

The innermost syntax node ending at or around pos whose name is in types, or null when there is none. Like upstream's tokenBefore, a node that contains the cursor counts: inside "ab|c" the String node is found, which is what lets ifIn/ifNotIn test "the cursor is in a string".