在Visual Studio Code中,切换完全限定的Go类型名称以查看变量值。

huangapple go评论76阅读模式
英文:

Toggle fully qualified Go type names to see variable values in Visual Studio Code

问题

我正在使用 Visual Studio Code 调试 Go 代码,但是我的屏幕不够大。结果是我无法在调试视图中看到任何变量的值,因为类型名称是像 github.com/companyname/project/some/deep/folder/maybe/Variable 这样的东西。有没有一种方法可以缩短这些类型名称?我已经找了一段时间,但没有找到。

英文:

I'm debugging Go code in Visual Studio Code and I don't have a large screen. The result is I can't see any of the variable values in the debug view because the type names are things like github.com/companyname/project/some/deep/folder/maybe/Variable. Is there a toggle to shorten these? I've looked for a while and can't see any.

答案1

得分: 1

在调试配置中使用“紧凑”视图的变量:

launch.json

"showCompact": true
英文:

Use compact view of variables in debug configuration:

launch.json

"showCompact": true,

huangapple
  • 本文由 发表于 2023年6月10日 07:43:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76444174.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定