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 a regex against the text before the cursor on the current line. Returns the match result or null.

Link copied to clipboard

Walk the syntax tree backward from pos looking for a node whose name is in types.