/vscode-eval-js

Evaluate selection in-place using safeEval

Primary LanguageTypeScript

Evaluate selection in-place

preview

Evaluate selection in-place using safeEval in vscode.

Commands

  • Evaluate and replace selection
  • Evaluate selection in global context

Example

Paste the lines in an empty editor then select them. The extension is dealing only with the selected lines, not the entire file.

  1. Run "Evaluate selection in global context" on the following lines.
a = 1
b = 2
c = "hello"
  1. Run "Evaluate and replace selection" on the following lines.
1+1
a*10+b
c+"world"
i
i
i
  1. You should get the following lines.
2
102
helloworld
3
4
5

Links