xmake-io / xmake-vscode

🍩 A XMake integration in Visual Studio Code
https://xmake.io
Apache License 2.0
229 stars 54 forks source link

插件中增加 buildDebug #271

Closed PolarLinda6 closed 1 month ago

PolarLinda6 commented 1 month ago

你在什么场景下需要该功能?

调试时, 每次改动代码后都需要先编译, 才能开始新的调试, 希望可以增加开始调试时自动编译的选项

描述可能的解决方案

xmake 增加类似 run.autobuild 的 debug.atuobuild 功能 , 或者在插件中增加 xmake.onbuildDebug 命令

waruqi commented 1 month ago

run.autobuild

这个原本就有

https://github.com/xmake-io/xmake-vscode/blob/2b6d88598326cfa27c2ede33b8aded9ac3dc3231/package.json#L43

或者切下 runMode 配置

https://github.com/xmake-io/xmake-vscode/blob/2b6d88598326cfa27c2ede33b8aded9ac3dc3231/package.json#L630

PolarLinda6 commented 1 month ago

作者你好, 指定 buildRun 可以解决这个问题, 但是会引入其他问题:

  1. xmake.onRun 时, 先编译报错一次, 运行再报错一次, 两次错误完全一样( 如图 )

PS: 指定 "xmake.runMode": "runOnly", policies = "run.autobuild" 可以解决这个问题, 但是无法实现 启动调试时自动编译 image

  1. 启动调试时, 即便编译失败, 仍会开始调试( 如图 ) image image
waruqi commented 1 month ago

https://github.com/xmake-io/xmake-vscode/issues/268#issuecomment-2254368465