Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] 请问 ide-debug 对应 core 代码库的哪个文件 #3510

Open
zhuzeyu22 opened this issue Apr 9, 2024 · 7 comments
Open

[Question] 请问 ide-debug 对应 core 代码库的哪个文件 #3510

zhuzeyu22 opened this issue Apr 9, 2024 · 7 comments
Labels
💬 question Further information is requested

Comments

@zhuzeyu22
Copy link
Contributor

我想修改 debug command,在命令前后做操作,但是注册的时候 不太清楚命令 debug.start 是在什么时候注册的,在其他模块做 commands.afterExecuteCommand 的注册的时候,似乎是失效了,因此想问问看,应该怎么改比较好???

请问 ide-debug 对应 core 代码库的哪个文件,我的想法是通过源码进行替换,但是全替换文件太多了,因此想先看看是怎么实现的,再想想怎么解决。

@zhuzeyu22 zhuzeyu22 added the 💬 question Further information is requested label Apr 9, 2024
@erha19
Copy link
Member

erha19 commented Apr 9, 2024

可以看一下这里,执行的代码在这里

async start(options: DebugSessionOptions): Promise<DebugSession | undefined> {

另外也可以考虑注册一个 task 之后通过调试配置的 preLaunchTask 去执行特定操作。

@Ricbet
Copy link
Member

Ricbet commented Apr 9, 2024

CommandRegistry 有个 beforeExecuteCommand 函数,可以对各种 command 命令做前置处理
image

@zhuzeyu22
Copy link
Contributor Author

可以看一下这里,执行的代码在这里

async start(options: DebugSessionOptions): Promise<DebugSession | undefined> {

另外也可以考虑注册一个 task 之后通过调试配置的 preLaunchTask 去执行特定操作。

因为命令是不能重复注册的,所以我注销之后马上又重新注册了一遍,强行做了命令注册的更新,请问会对其他模块的before after 这类的关联操作有影响吗?

@zhuzeyu22
Copy link
Contributor Author

beforeExecuteCommand 这里我又尝试了下,生效了,很开心

@erha19
Copy link
Member

erha19 commented Apr 9, 2024

@zhuzeyu22 感觉你需要这个东西 #3468

@zhuzeyu22
Copy link
Contributor Author

@erha19 感觉 debug tools 里面没有调用 DEBUG_COMMANDS.START 里面的命令,命令注册进去了,但是没有调用到

@zhuzeyu22
Copy link
Contributor Author

@erha19 这里遇到个问题 DebugToolbarService 里面 reload 直接调用的是 doRestart 函数对 this.model.restart(); 这里拦截不到。很烦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants