JSContext
JSContext =
object
Defined in: extensions/autocomplete/javascript/index.ts:12
Properties
Section titled “Properties”disabled
Section titled “disabled”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
Section titled “tagMatch”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:
- The tag’s name
- The last attribute’s name
- Is present if the cursor is inside an attribute value