Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default tasks? #30

Open
daurnimator opened this issue Feb 23, 2020 · 2 comments
Open

Default tasks? #30

daurnimator opened this issue Feb 23, 2020 · 2 comments

Comments

@daurnimator
Copy link

daurnimator commented Feb 23, 2020

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
            }
        }
    ]
}
@Swoogan
Copy link
Contributor

Swoogan commented Feb 26, 2020

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).

@markfirmware
Copy link
Contributor

@Swoogan @daurnimator

Can we provide the tasks from build.zig automatically?

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

alunbestor added a commit to alunbestor/AZiggierWorld that referenced this issue Aug 29, 2020
These are mostly cribbed from ziglang/vscode-zig#30, with the addition of defining zig's `main-pkg-path` to be the workspace. This permits zig files to include any file within the workspace; otherwise, `@import`s of paths outside the zig file's own directory tree will fail with a compile error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants