microsoft / microsoft/vscode-java-debug
Add Support For Showing a Custom Type View via TypeCustomDebugDataView or Annotations
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 591
- 派生
- 429
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 19
描述
Hi,
It seems currently vscode-java-debug doesn't support a way to have different representations of a type during debug in inline view, "variables" and "watch" windows.
Environment
- Operating System: Windows 10 19043.1645 (x64)
- JDK version: Java 11 (Oracle JDK 16)
- Visual Studio Code version: 1.66.2
- Java extension version: 1.6.0
- Java Debugger extension version: 0.40.1
Steps To Reproduce
- Start a debugging session in vscode for any java file.
- See how class variables are represented in inline-view, "variables" and "watch" windows.
Current Result
For example, here is how it looks like during debug - inline view (extension version v0.40.1):

and here is overridden toString method in the Point class:

notice, I have the following options in .vscode/settings.json:
{
"java.debug.settings.showQualifiedNames": false,
"java.debug.settings.showToString": true,
"java.debug.settings.showLogicalStructure": true
}
also, when I expand an array in the variable view, the nested types are not showing until I click(...):

It seems there are no ways to enable a custom data view for a particular types, right?
Expected Result
It would be cool to have something like that:

It seems like it can be done using either:
- Adding an option to enable displaying a result of overridden
toStringmethod, e.g.java.debug.settings.showToStringInlineView: true - Add "Java Type Renderer" to support custom data views similar to IntellijIdea "debugger -> Customize Data Views -> Java Type Renderer" (see link
#1in Additional Informations) - Add something like
DebuggerDisplayannotation similar to C#DebuggerDisplayAttribute(see link#2in Additional Informatins)
For me the second way seems more appealing because it may allow setting custom debug views even for Java internal classes like java.utils.ArrayList
Additional Informations
For example, here are some StackOverflow questions that illustrate the problem:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定源文件、测试或入口点。首先跟踪 vscode-java-debug 如何在 inline、Variables 和 Watch 视图中呈现值,然后比较提议的 TypeCustomDebugDataView、annotation 和 toString 方案。完成标准是确定一个一致同意的设计,并在所请求的视图中支持自定义类型表示。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100