Description
Voice commands such as add continue statement should be context specific, in the sense that the continue keyword is only allowed inside a loop statement (while, do...whie and for). This can be achieved by using a parser to read and make sense of the surrounds before the command execution.
In the snippet below, where the mouse is in line 3, a valid command could be invert the conditional statement and that would transform value > 112 in !(value > 112), but before doing that we need to know that in line 3 we have a JavaScript conditional statement and not some random piece of text. This can be achieved with JS parsers such as Esprima and Reflect.js
1 const value = 7 * 42
2
3 if (value > 112) { | // <- mouse cursor is here!
4 ...
The aim of this issue is to use a programming language parser to make sense of the surrounds in order to offer context specific voice commands.
Description
Voice commands such as add
continuestatement should be context specific, in the sense that thecontinuekeyword is only allowed inside a loop statement (while,do...whieandfor). This can be achieved by using a parser to read and make sense of the surrounds before the command execution.In the snippet below, where the mouse is in line
3, a valid command could be invert the conditional statement and that would transformvalue > 112in!(value > 112), but before doing that we need to know that in line3we have a JavaScript conditional statement and not some random piece of text. This can be achieved with JS parsers such as Esprima and Reflect.jsThe aim of this issue is to use a programming language parser to make sense of the surrounds in order to offer context specific voice commands.