Skip to content

JSContext

JSContext = object

Defined in: extensions/autocomplete/javascript/index.ts:12

disabled: boolean

Defined in: extensions/autocomplete/javascript/index.ts:17

Whether autocomplete should be disabled due to happening inside a regex, string, comment or variable name declaration.


path: string[] | null

Defined in: extensions/autocomplete/javascript/index.ts:29

List of identifiers that were separated by . or ?. before the cursor.

Here’s a list of strings before the cursor and the corresponding path:

  • a.b.c -> ["a", "b", "c"]
  • a.b. -> ["a", "b", ""]

If there’s no identifier before the cursor, the path will be [""]. If completion shouldn’t happen where the cursor is, path will be null. If tagMatch is present, path will also be null.


tagMatch: null | RegExpExecArray

Defined in: extensions/autocomplete/javascript/index.ts:39

If the current language is jsx or tsx and the cursor is in a tag, this match will be present.

There are three capture groups:

  1. The tag’s name
  2. The last attribute’s name
  3. Is present if the cursor is inside an attribute value