microsoft / microsoft/vscode-java-debug

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

Ouverte
#1,395 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

ai-triaged question
Langage dominant
TypeScript
Étoiles
591
Forks
429
Merge moyen
1 j 9 h
PR mergées (30 j)
19

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Aucun fichier du dépôt ni aucun test n’est nommé. Commencez par suivre les points d’entrée existants du VS Code Java debug adapter pour breakpoint et step-over, puis comparez-les au comportement de breakpoint-event de JDWP décrit ici ; le travail est terminé lorsqu’un point d’extension pris en charge est identifié ou qu’il est documenté que cela nécessite une implémentation de debugger distincte.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java, typescript, vscode
Domaine
developer-experience, devtools
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.