turbo-editors/turbo-gopublic Fork 0
v1.0.0
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-go.git
git clone ssh://git@rickub.com/turbo-editors/turbo-go.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

📦 Turbo Go 3d7798b · on v1.0.0 · k33g · 10h ago
templates.go · 59 lines · 2.5 KBGo Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package golang

import _ "embed"

// The starter files Turbo Go writes into a project's .turbo-go directory.
//
// They live in four files beside this one and are embedded into the binary at
// compile time. Written out as text rather than encoded from structs because
// they are meant to be read and edited by a person: the comments in them say
// what each key is for, which is the whole reason the editor offers to create
// them at all rather than only to read them.
//
// Their contents are the one part of these four files that is about Go
// rather than about editing, which is why they live here and not in turbo-core.
//
// **The .tmpl suffix is not decoration.** Each file is formatted with
// fmt.Sprintf before it is written, and settings.toml.tmpl holds `theme = %q`
// — which is not valid TOML. Naming it settings.toml would be a claim it
// cannot meet: a TOML linter would reject it, and Turbo Go itself would colour it
// as TOML and draw it as broken. The blanks each one takes are documented on
// profile.Templates, and templates_test.go holds them to it.

// settingsTemplate is the settings file a project gets when it asks for one.
//
// autosave is on: a project that has gone to the trouble of creating a
// settings file has said what it wants, and the file is the visible, editable
// place to say otherwise. settings.Default() — what applies with no file at
// all — stays off.
//
//go:embed settings.toml.tmpl
var settingsTemplate string

// snippetsTemplate is the snippets file a project gets when it asks for one.
//
// It lists every language name the editor knows in its `languages` comment,
// because that comment is where a user finds out what they may write there. A
// test iterates syntax.Registered() rather than a hardcoded list, so the
// comment cannot fall behind the registry.
//
//go:embed snippets.toml.tmpl
var snippetsTemplate string

// toolsTemplate is the tools file a project gets when it asks for one.
//
// Five commands, and the two features that are invisible otherwise: a
// {{placeholder}} that asks for a value before the command runs, and the
// `menu` key that puts a tool in a menu of its own.
//
//go:embed tools.toml.tmpl
var toolsTemplate string

// agentsTemplate is the agents file a project gets when it asks for one.
//
// It takes one blank, used twice: the editor's own project directory. The
// example agent's arguments point at a configuration file kept beside this one,
// and the comment says where a user-level copy of the file would live.
//
//go:embed acp.toml.tmpl
var agentsTemplate string