1
0
mirror of https://github.com/go-task/task.git synced 2024-12-14 10:52:43 +02:00
task/internal/editors/output.go
Pete Davison e40d2eec9e
feat: add task location data to json output (#1056)
* feat: add task location data to json output

* feat: add root taskfile location to --json output
2023-03-17 12:34:06 +00:00

24 lines
621 B
Go

package editors
type (
// Taskfile wraps task list output for use in editor integrations (e.g. VSCode, etc)
Taskfile struct {
Tasks []Task `json:"tasks"`
Location string `json:"location"`
}
// Task describes a single task
Task struct {
Name string `json:"name"`
Desc string `json:"desc"`
Summary string `json:"summary"`
UpToDate bool `json:"up_to_date"`
Location *Location `json:"location"`
}
// Location describes a task's location in a taskfile
Location struct {
Line int `json:"line"`
Column int `json:"column"`
Taskfile string `json:"taskfile"`
}
)