Returns a CursorInfo object, see it for details.
Mostly for internal use by autosuggest .
Returns all error tokens immediately before/after cursor (since there might be multiple error tokens one after the other).
The errors are sorted by closeness to the given cursor (inside CursorInfo), with quote errors having priority, then paren errors, then any other errors. They can be sorted by closeness because although two errors might follow each other, their positions might be different because of whitespace, but they can still be fixed from any cursor position between their ends.
For example:
a a"
^ operator missing at 1
^ doublequote missing at 2
if the cursor is at 1 (`a| a"`):
errors = [operator, doublequote]
if the cursor is at 2 (`a |a"`):
errors = [doublequote, operator]
either insertion would fix the issue for either position would fix the issue, albeit with different results
Returns a more compressed, color coded, string representation of the ast for debugging.
There are options to change which symbols are used for tree and if the variables are surrounded by quotes (default false).
Colors can changed by passing ansi codes (or whatever you want*) to the third parameter. Or you can pass false instead of an object to disable them. Default colors are:
{
values: // yellow,
position: // green,
info: // cyan,
hint: // blue,
error: // red,
reset: // ansi reset code
}
* For example, you could pass html tags to show this in the browser instead (this is how the demo works). This is why the reset color is exposed. For example, a color might be <span class="error"> and reset can be </span>.
Generated using TypeDoc
Extract a list of all the tokens (which might or might not be valid).