xmake-io / xmake-vscode

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

使用用户 launch.json 自定义 env #77

Closed q962 closed 2 years ago

q962 commented 2 years ago

看了代码,调试并没有做环境变量处理。

所以 xmake.lua set_runenv 无法生效

xmake 可以有办法输出 set_runenv 的值吗?如果有那就不需要用户写两次 env

https://github.com/q962/xmake-vscode/commit/92673c53362ed7008501d35e47c7622629751e68

waruqi commented 2 years ago

目前不支持,需要改插件透传envs到

https://github.com/xmake-io/xmake-vscode/blob/81d8903b88d65f284badb5619b1b67d19cfa9e65/src/debugger.ts#L96

q962 commented 2 years ago

是的,我这么做了 https://github.com/q962/xmake-vscode/commit/92673c53362ed7008501d35e47c7622629751e68

waruqi commented 2 years ago

其实也不用这么搞,现在原本就支持的,走 xmake.customDebugConfig 配置覆盖 environment 就行了,不需要改插件

https://github.com/xmake-io/xmake-vscode/blob/81d8903b88d65f284badb5619b1b67d19cfa9e65/src/debugger.ts#L156-L159

q962 commented 2 years ago

嗯,确实一样的效果。