在 VS Code 中调试时观察窗口或评估表达式? [英] Watch window or evaluate expressions while debugging in VS Code?

查看:27
本文介绍了在 VS Code 中调试时观察窗口或评估表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢 Visual Studio Code,它是一个很棒的编辑器,但是在调试 Node 时有一件事让我很烦应用:

I really like Visual Studio Code, it's a great editor but one thing is really annoying me while debugging Node apps:

我看不到任何类型的监视窗口或在调试时评估表达式的能力.这使得调试非常痛苦,我正在考虑回到 VS 2013.

I can't see any sort of watch window or the ability to evaluate expressions while debugging. This makes debugging pretty painful and I'm considering moving back to VS 2013.

我知道我们有局部和全局变量窗口,但浏览它们很麻烦(也许添加一个搜索框?)而且有些东西没有出现在列表中.

I know we have the local and global variables windows but they are a pain to look through (maybe add a search box?) and some things just don't appear in the list.

例如使用 TypeScript,一个类函数可以编译成这样:

For example using TypeScript, a class function compiles down to something like this:

Stack.prototype.push = function (item) {
    if (this.items.length == this.length)
        this.resize(length * 2);
    this.items[this.length++] = item;
};

在调试此函数时,我在 push() 函数中无法访问 this 变量.它既没有出现在局部变量中,也没有出现在全局变量中,我无法在任何地方对其进行评估.

When debugging this function however I don't have any access to the this variable while in the push() function. It does not appear in either the local or global variables and I can't evaluate it anywhere.

有没有其他人遇到过这种情况并找到了解决方案?

Has anyone else experienced this and found a solution?

推荐答案

从 0.6.0 VS Code 版本开始支持 watch 并且从 0.8.0 VS Code 有一个调试控制台(又名 REPL).

Since version 0.6.0 VS Code supports watches and since 0.8.0 VS Code has a debug console (aka REPL).

缺少此"问题已修复.

这篇关于在 VS Code 中调试时观察窗口或评估表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆