Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandVars ¶
ExpandVars expands ${workspaceFolder}, ${workspaceFolderBasename}, ${env:NAME}. Unknown ${…} tokens return an error.
func StripJSONC ¶
StripJSONC removes // line comments and trailing commas so data can be parsed as standard JSON (VS Code tasks.json style).
func UnmarshalJSONC ¶
UnmarshalJSONC parses JSONC into v.
Types ¶
type File ¶
File is the top-level tasks.json structure.
func ParseTasksJSON ¶
ParseTasksJSON parses JSONC tasks content.
func (*File) FindSubstring ¶
FindSubstring returns tasks whose labels contain query (case-insensitive).
type Task ¶
type Task struct {
Label string `json:"label"`
Type string `json:"type"`
Command string `json:"command"`
Args []string `json:"args"`
IsBackground bool `json:"isBackground"`
Options *TaskOptions `json:"options"`
DependsOnRaw json.RawMessage `json:"dependsOn"`
DependsOn []string `json:"-"`
Group json.RawMessage `json:"group"`
}
Task is a VS Code task entry.
func (*Task) CommandPreview ¶
CommandPreview builds a short command line for list/show.
type TaskOptions ¶
type TaskOptions struct {
Cwd string `json:"cwd"`
}
TaskOptions holds options.cwd etc.
type Workspace ¶
Workspace holds the resolved root and tasks.json path.
func FindWorkspace ¶
FindWorkspace walks up from startDir (or cwd) until .vscode/tasks.json exists.