microsoft / microsoft/vscode-java-debug

[Question] How to develop a vscode plugin to Influence debugging behavior

Abierto
#1,395 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

ai-triaged question
Lenguaje dominante
TypeScript
Estrellas
591
Forks
429
Merge medio
1 d 9 h
PR fusionados (30 d)
19

Descripción

I have developed a library JAsync to add async/await support to Java. The library converts the await function to a callback at the bytecode level. At least for now, at the level of writing code, with this library, users already have the same experience with async/await as they do with csharp and js. However, during debugging, when the user breaks to the line containing the await, the user expects the code to stop at the next line after executing the next step, but in reality, the code jumps to the inside of the one function that handles callbacks in the JAsync framework. Because the actual code has become a callback, the code on paper is not executed immediately. I want change this behavior. I have tried writing a jvmti agent. But I found breakpoint event is exclusive. Since jdwp has reuqested the breakpoint event right, my agent can't achieve it again. So I decide to develop a plugin of ide to fix it.
Here is my thought.
For example:

var a = someFunc().await();  // line 1
System.out.println(a); // line 2

will be converted to this in byte code:

someFunc().then(a -> {  // line 1
    System.out.println(a);  // line 2
})

If user add a breakpoint to line 1, And the progrem has topped at line 1. In my plugin, I can get report of it, So my plugin will add a breakpoint to real line2 in the lambda method which JAsync generated. When the user press the step over button, my plugin execute continue instead of step over, when the progrem stop at line 2, my plugin will remove the breadpoint.
I came here to ask you guys How can I develop such a plugin that only changes part of the behavior of the current debugging plugin, instead of starting from scratch and writing a new one?

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

No se nombra ningún archivo del repositorio ni ninguna prueba. Empieza trazando los puntos de entrada existentes del VS Code Java debug adapter para breakpoint y step-over, y compáralos después con el comportamiento de breakpoint-event de JDWP descrito aquí; se considera terminado cuando se identifique un punto de extensión compatible o se documente que esto requiere una implementación de debugger independiente.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, typescript, vscode
Área
developer-experience, devtools
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.