-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE-6195] Disable JS Completions #495
Conversation
src/commands/shell.mjs
Outdated
ignoreUndefined: true, | ||
preview: argv.apiVersion !== "10", | ||
// TODO: integrate with fql-analyzer for completions | ||
completer: argv.apiVersion === "10" ? () => [] : undefined, | ||
completer: () => [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah your right - let me take a closer look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way the old code works is by making a nodeJS sub-vm with a context object that only contains the names defined in v4 syntax. so, setTimeout isn't a suggestion because setTimeout isn't defined as a global var in the sub-vm that evaluates completions.
https://nodejs.org/api/vm.html#scriptruninnewcontextcontextobject-options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thank you for looking into it!
6ffc16b
to
9fdcb13
Compare
Ticket(s): FE-6195
Problem
Setting
completer: undefined
when we set up the repl means we default to JS completions. This is why you can get things like:setTimeout
is of course not a function in Fauna. Previously the shell would parse the expression and catch the appropriate error code to avoid logging these sorts of errors. See here:fauna-shell/src/commands/shell.js
Line 109 in 1c5153c
Solution
Disable JS completions as these don't make sense here.
Testing
Behold typing
Time.
does not blow up: