microsoft / microsoft/vscode-java-debug

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

未关闭
#1,395 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged question
主要语言
TypeScript
星标
591
派生
429
平均合并
1 天 9 小时
30 天内合并 PR
19

描述

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?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定任何 repository 文件或测试。首先跟踪现有 VS Code Java debug adapter 中 breakpoint 和 step-over 的入口点,然后将其与此处描述的 JDWP breakpoint-event 行为进行比较;完成的标准是确定一个受支持的扩展点,或记录这需要单独的 debugger 实现。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript, vscode
领域
developer-experience, devtools
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。