microsoft / microsoft/vscode-java-debug
Add Support For Showing a Custom Type View via TypeCustomDebugDataView or Annotations
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 591
- Forks
- 429
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 19
Descripción
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:
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
No se nombran archivos fuente, pruebas ni puntos de entrada. Empieza por rastrear cómo vscode-java-debug renderiza los valores en las vistas inline, Variables y Watch, y después compara los enfoques propuestos TypeCustomDebugDataView, annotation y toString. Se considerará terminado cuando haya un diseño acordado y compatibilidad con representaciones personalizadas de tipos en las vistas solicitadas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, typescript
- Área
- devtools
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100