如何在 Visual Studio 代码中配置 launch.json? --path 变量不起作用

How to configure launch.json in Visual Studio Code? --path variable not working

我正在尝试从 Visual Studio 代码

启动 Godot

我可以使用以下命令从命令行启动 Godot:

/Applications/godot-3.3.2-stable/bin/godot.osx.tools.x86_64 --path /Users/admin/Documents/Demeria/project/ blocky_game/blocky_game.tscn

但是,当我尝试将该命令复制到 launch.json 文件时,它无法工作,因为它似乎忽略了 --path 参数并且无法找到它需要的文件。

这是我的 launch.json 文件:

"configurations": [
        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            //"program": "${workspaceFolder}/bin/godot.osx.tools.x86_64",
            "program": "/Applications/godot-3.3.2-stable/bin/godot.osx.tools.x86_64",
            "args": [
                "-v",
                "--path /Users/admin/Documents/Demeria/project/",
                "/Users/admin/Documents/Demeria/project/blocky_game/blocky_game.tscn",
                
                
            ],
            "internalConsoleOptions": "openOnSessionStart",
            "stopAtEntry": false,
            "cwd": "/Users/admin/Documents/Demeria/project/",
            "environment": [],
            "externalConsole": true,
            "MIMode": "lldb",
            "visualizerFile": "${workspaceFolder}/modules/voxel/voxel.natvis",
            "osx": {
                "MIMode": "lldb" 

有人知道如何使用 --path 变量吗?

您需要像这样将 --path 与其参数分开:

"configurations": [
    {
        "name": "(lldb) Launch",
        "type": "cppdbg",
        "request": "launch",
        //"program": "${workspaceFolder}/bin/godot.osx.tools.x86_64",
        "program": "/Applications/godot-3.3.2-stable/bin/godot.osx.tools.x86_64",
        "args": [
            "-v",
            "--path",
            "/Users/admin/Documents/Demeria/project/",
            "/Users/admin/Documents/Demeria/project/blocky_game/blocky_game.tscn",
            
        ],
        "internalConsoleOptions": "openOnSessionStart",
        "stopAtEntry": false,
        "cwd": "/Users/admin/Documents/Demeria/project/",
        "environment": [],
        "externalConsole": true,
        "MIMode": "lldb",
        "visualizerFile": "${workspaceFolder}/modules/voxel/voxel.natvis",
        "osx": {
            "MIMode": "lldb"