Skip to content

Templates

Marcelo Fornet edited this page May 23, 2020 · 1 revision

For several types of files templates are allowed in settings.

Default

The simplest case is when the the template setting is a string with the path to the file that will be used as template. In that case, the file is copied into the workspace with the same name.

Multiple files template

Some languages require several files to be added to the workspace (as part of a project) to be able to run. Use the following syntax to bring multiple files and folders and signalling which is the source code:

path/to/folder/@path/to/file

Everything under path/to/folder will be copied, and in particular path/to/folder/path/to/file will be used as the main source code copied.

For example, suppose you have a default rust project created with cargo init:

template/
    src/
        main.rs
    Cargo.toml

To add this as the template use:

path/to/template/@src/main.rs

Using this strategy it is possible to bring a Makefile to each workspace, or different config files.