Skip to content

feat: Auto-generation of launch.json and tasks.json #977

Open
@yuxuan-z19

Description

@yuxuan-z19

Is there an existing request for this?

  • I have searched the existing issues

Feature Request

I'd like to request a feature "Fortran: gfortran build and debug active file", just like what the C/C++ extension does when someone debugs his .c or .cpp source code. Obviously we need tasks.json configured as well (to setup a preLaunchTask).

Here are my configurations:

// .vscode/launch.json
{
    "configurations": [
        {
            "name": "Fortran: gfortran build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "preLaunchTask": "Fortran: gfortran build active file", 
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}
// .vscode/tasks.json
{
    "tasks": [
        {
            "type": "shell",
            "label": "Fortran: gfortran build active file",
            "command": "/usr/bin/gfortran",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger"
        }
    ],
    "version": "2.0.0"
}

I was wondering if there's a way to generate launch.json and tasks.json automatically with minor modification to this extension.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions