interface Typed

A name and a path: document.qu is qu hanging off document, doc is doc off nothing.

Properties

base: string

The expression whose properties could finish the token, or '' for a bare name.

Only ever a dotted path of plain identifiers. Anything else — foo().bar, list[0]., a string in mid-flight — is not a base and this reports no completion at all, because the base has to be EVALUATED to find out what is on it, and a keystroke is no reason to run somebody's function call.

token: string

The partial identifier under the cursor, empty directly after a dot.

Usage

import { type Typed } from "lib/repl/suggest.ts";