vscode-zig icon indicating copy to clipboard operation
vscode-zig copied to clipboard

Default tasks?

Open daurnimator opened this issue 4 years ago • 2 comments

Is providing some default tasks something a vscode extension does? Maybe something like

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "zig build-exe",
            "type": "process",
            "command": "zig",
            "args": [
                "build-exe",
                "${file}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "reveal": "silent",
                "showReuseMessage": false,
                "clear": true
            }
        },
        {
            "label": "zig run",
            "type": "process",
            "command": "zig",
            "args": [
                "run",
                "${file}"
            ],
            "group": "build",
            "presentation": {
                "showReuseMessage": false,
                "clear": true
            }
        },
        {
            "label": "zig test",
            "type": "process",
            "command": "zig",
            "args": [
                "test",
                "${file}"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "presentation":{
                "showReuseMessage": false,
                "clear": true
            }
        }
    ]
}

daurnimator avatar Feb 23 '20 11:02 daurnimator

Extensions can add commands to the command palette. See, for example, the go extension by Microsoft: https://github.com/microsoft/vscode-go/blob/master/package.json#L137

This is something I was planning to add once my other PRs were merged (which they have been).

Swoogan avatar Feb 26 '20 16:02 Swoogan

@Swoogan @daurnimator

Can we provide the tasks from build.zig automatically?

https://code.visualstudio.com/api/extension-guides/task-provider

markfirmware avatar May 27 '20 17:05 markfirmware