xmake-io / xmake-vscode

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

在launch.json的配置中`target`属性使用Vscode变量 #200

Open hotsnow-sean opened 1 year ago

hotsnow-sean commented 1 year ago

Xmake 版本

2.7.8

操作系统版本和架构

Windows 11 version 22H2

描述问题

launch.json 配置文件示例如下:

{
  "configurations": [
      {
        "type": "xmake",
        "request": "launch",
        "name": "Debug XMake target",
        "target": "${fileBasenameNoExtension}",
        "cwd": "${workspaceFolder}",
        "stopAtEntry": true
      }
    ]
}

由于在target中使用了变量${fileBasenameNoExtension},导致使用vscode自带的调试按钮或者F5开启调试时插件提示The target program not found! image

期待的结果

期望可以在launch.json中target属性使用vscode变量

工程配置

No response

附加信息和错误日志

简单调试后发现,可以将插件中launchDebugger.ts文件里的resolveDebugConfiguration函数换成使用resolveDebugConfigurationWithSubstitutedVariables这个API,可以成功调试,但不确定是否会造成其它影响。