-
Notifications
You must be signed in to change notification settings - Fork 6
Commands
Javascript REPL extension can be activated on the following file types: (.js, .ts, .coffee, .jsx, .tsx, .vue). Users that have installed the extension, if the press in vscode cmd(or ctrl) + shift + p and type "JS Repl:" in command window, they will see the list of available commands
- By pressing cmd(or ctrl) + shift + l as a shortcut or by using the command
"JS Repl: Run"
- By pressing the start indicator at the top right corner of their current editor
- By pressing right-click in their current editor area, and select the command
"JS Repl: Run"
Users that have more than one different repl session can stop a specific session
- By using the command:
"JS Repl: Stop on Current File"
. - By pressing the stop indicator at the top right corner of their current editor that they want to stop
- By pressing right-click in their current editor area, and select the command
"JS Repl: Stop on Current File"
Users that have more than one different repl sessions they can stop all active repl sessions by typing the command: "JS Repl: Stop for all files"
Users can select the following commands based on the type of code that they want to test
- "JS Repl: New Javascript File (.js)"
- "JS Repl: New React File (.jsx)"
- "JS Repl: New TypeScript File (.ts)"
- "JS Repl: New TypeScript React File (.tsx)"
- "JS Repl: New CoffeeScript File (.coffee)"
Users can show the value of expression without to print console.log or use the special comment. They need to select the expression in their editor and run the vscode command "JS Repl: Show Value"
in order to print the value in the editor and log explorer. These logged values are not permanent and after their next edit, neither are printed in their editors nor are shown in the log Explorer at the left.
Besides, if they can select and print more than one value.
Users can copy the return value of the desired expression by selecting the expression in their editor and after that to run the command "JS Repl: Copy Value"
in vscode. If more than one expression is selected, the value of the first selected expression is saved to their clipboard.
If users have log explorer active in their config file, they can inspect nested objects or arrays in the log explorer at the left. So if they run the command "JS Repl: Reveal in explorer"
and the cursor position of their current editor has a printed log, the value is revealed expanded in log explorer. Users can do the same thing by pressing right-click in their current editor area and select the command "JS Repl: Reveal in explorer"
in the context menu.
If users have log explorer active in their config file, they can press right-click to a value(error or log) and select from the context menu neither "JS Repl: Copy Value"
or "JS Repl: Show Log"
.
The show log option moves their cursor position in the editor at the line of value. If the editor is closed, it will be revealed.