Documentation
¶
Index ¶
- func NewContextWithProject(ctx context.Context, project *Project) context.Context
- type Config
- type File
- func (f *File) Equals(other *File) bool
- func (f *File) GetContent() string
- func (f *File) GetContentBytes() []byte
- func (f *File) GetLine(lineNumber int) Line
- func (f *File) GetLineRange(start, end int) []Line
- func (f *File) ReplaceLineRange(start, end int, content string) (*File, error)
- func (f *File) WithLineRange(start, end int) *File
- func (f *File) WithPath(path string) *File
- type Files
- type Line
- type Project
- type ProjectId
- type TaskNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
DevContainerConfig devcontainer.Config `json:"devContainerConfig"`
}
type File ¶
type File struct {
Path string `json:"path"`
Lines []Line `json:"lines"`
// NOTE: should diagnostics be part of a line?
Diagnostics []protocol.Diagnostic `json:"diagnostics,omitempty"`
}
func NewFile ¶
NewFile creates a new File from the given path and content. Content is split into lines. Line numbers are 1-based.
func (*File) GetContent ¶
func (*File) GetContentBytes ¶
func (*File) GetLine ¶
GetLine returns the line with the given line number. Line numbers are 1-based.
func (*File) GetLineRange ¶
GetLineRange returns the lines between start and end (exclusive). Line numbers are 1-based.
func (*File) ReplaceLineRange ¶
ReplaceLineRange replaces the lines between start and end (exclusive) with the given content. Line numbers are 1-based.
func (*File) WithLineRange ¶
WithLineRange returns a new File with the lines between start and end (exclusive). Line numbers are 1-based.
type Project ¶
type Project struct {
Id ProjectId `json:"id"`
Path string `json:"path"`
Config Config `json:"config"`
ContainerId string
}
func NewProject ¶
func ProjectFromContext ¶
ProjectFromContext returns the project from the context
func (*Project) FindTaskByAlias ¶
func (project *Project) FindTaskByAlias(alias string) (devcontainer.Task, error)
func (*Project) GetTasks ¶
func (project *Project) GetTasks() []devcontainer.Task
type TaskNotFoundError ¶
type TaskNotFoundError struct {
// contains filtered or unexported fields
}
func NewTaskNotFoundError ¶
func NewTaskNotFoundError(taskId string) *TaskNotFoundError
func (TaskNotFoundError) Error ¶
func (e TaskNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.