简体   繁体   English

从 vscode 调试控制台访问 javascript 变量(运行 node.js)

[英]Accessing javascript variables from the vscode debug console (with node.js running)

从 vscode 调试控制台,我如何访问 javascript 对象,例如,调用测试/调试方法而不会在断点处停止?

From the VSCode documentation on debugging :关于调试VSCode 文档

Debug Console REPL调试控制台 REPL

Expressions can be evaluated with the Debug Console REPL ( Read-Eval-Print Loop ) feature.可以使用调试控制台REPL( 读取-评估-打印循环)功能评估表达式。 To open the Debug Console , use the Debug Console action at the top of the Debug pane or use the View: Debug Console command ( ⇧⌘Y ).要打开调试控制台,请使用调试窗格顶部的调试控制台操作或使用查看:调试控制台命令 ( ⇧⌘Y )。 Expressions are evaluated after you press Enter and the Debug Console REPL shows suggestions as you type.在您按下Enter后,将评估表达式,并且调试控制台 REPL 会在您键入时显示建议。 If you need to enter multiple lines, use Shift+Enter between the lines and then send all lines for evaluation with Enter .如果您需要输入多行,请Shift+Enter之间使用Shift+Enter ,然后使用Enter发送所有行进行评估。 Debug Console input uses the mode of the active editor, which means that the Debug Console input supports syntax coloring, indentation, auto closing of quotes, and other language features.调试控制台输入使用活动编辑器的模式,这意味着调试控制台输入支持语法着色、缩进、自动关闭引号和其他语言功能。

VSCode 调试控制台截图

Note : You must be in a running debug session to use the Debug Console REPL.注意:您必须处于正在运行的调试会话中才能使用调试控制台 REPL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM