microsoft / microsoft/vscode-java-debug

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

Aperta
#1,395 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

ai-triaged question
Lingua principale
TypeScript
Stelle
591
Fork
429
Merge medio
1g 9h
PR unite (30g)
19

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Non viene indicato alcun file del repository né alcun test. Inizia tracciando i punti di ingresso esistenti del VS Code Java debug adapter per breakpoint e step-over, quindi confrontali con il comportamento di breakpoint-event di JDWP descritto qui; il lavoro è completato quando viene identificato un punto di estensione supportato oppure viene documentato che ciò richiede un’implementazione separata del debugger.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, typescript, vscode
Ambito
developer-experience, devtools
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.