xmake-io / xmake-vscode

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

debug 时自定义传入程序的参数 #2

Closed Sunnny-3n closed 6 years ago

Sunnny-3n commented 6 years ago

xmake-vscode 似乎在 debug 时不能自定义参数,望可以加入自定义参数的选项

waruqi commented 6 years ago

好的,我后两天改进下。

waruqi commented 6 years ago

我加上了,你更新下插件试试,xmake.additionalDebuggerTargetArguments 参数,是个 string数组,["xxx", "sxx"]

并且我同时修复了下vscode插件上的bug,建议xmake也同时更新下(不是必须),win最新版:https://github.com/tboox/xmake/releases/download/v2.2.1/xmake-v2.2.2-dev.exe

mac/linux直接更新master版本就好。

Sunnny-3n commented 6 years ago

可不可以根据 Target 的不同自动选择参数

waruqi commented 6 years ago

这个版本你先这么凑活着用吧,分target 需要想想怎么弄比较好,需要花点时间。

waruqi commented 6 years ago

我改了下,你再试试,版本:1.1.5

 "xmake.debuggingTargetsArguments": {
        "default": ["stream", "http://www.baidu.com", "/tmp/a"],
        "target2": ["xxxx", "3444", "aaaa"]
    }
wangzhankun commented 2 years ago

我改了下,你再试试,版本:1.1.5

 "xmake.debuggingTargetsArguments": {
        "default": ["stream", "http://www.baidu.com", "/tmp/a"],
        "target2": ["xxxx", "3444", "aaaa"]
    }

请问这个配置文件是要写道哪里呀?如果是运行不是debug也可以使用这个方法吗?

wangzhankun commented 2 years ago

我找到了,是写到工作区的setting.json,路径是.vscode/setting.json,如果不存在可以创建。如果运行和debug模式应该添加的参数应该是:

{
    "xmake.debuggingTargetsArguments": {
        "default": [
            "stream",
            "http://www.baidu.com",
            "/tmp/a"
        ],
    },

    "xmake.runningTargetsArguments": {
        "default": [
            "stream",
            "http://www.baidu.com",
            "/tmp/a"
        ],
    }
}
xiaomi2077 commented 2 years ago

是不是又改成./vscode/settings.json文件了?

yinkaisheng commented 9 months ago

我找到了,是写到工作区的setting.json,路径是.vscode/setting.json,如果不存在可以创建。如果运行和debug模式应该添加的参数应该是:

{
    "xmake.debuggingTargetsArguments": {
        "default": [
            "stream",
            "http://www.baidu.com",
            "/tmp/a"
        ],
    },

    "xmake.runningTargetsArguments": {
        "default": [
            "stream",
            "http://www.baidu.com",
            "/tmp/a"
        ],
    }
}

是.vscode/settings.json,不是.vscode/setting.json