Skip to content

Feature Request: ability to add prepend/append code #32

@nxuv

Description

@nxuv

I.e for running C or C++ or D code i'd have to prepend and append some code before running it

For C it'd be something like

#include <stdio.h>

int main() {
    // SELECTED CODE GOES HERE
    return 0;
}

For C++ it'd be something like

#include <iostream>

int main() {
    // SELECTED CODE GOES HERE
    return 0;
}

For D it'd be something like

/+ dub.sdl:
name "test"
+/

import std;

void main() {
    // SELECTED CODE GOES HERE
}

So possibly allow in file_types to have definition of something like file_template, i.e

opts = {
    file_types = {
        d = {
            cmd = "dub run --single",
            file_template = '/+ dub.sdl:\nname "test"\n+/\nimport std;\nvoid main() {\n${CODE}\n}\n'
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions